state
stringlengths
0
159k
srcUpToTactic
stringlengths
387
167k
nextTactic
stringlengths
3
9k
declUpToTactic
stringlengths
22
11.5k
declId
stringlengths
38
95
decl
stringlengths
16
1.89k
file_tag
stringlengths
17
73
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : IsCyclotomicExtension {n} K L this : DecidableEq L := Classical.decEq L ⊢ adjoin K (rootSet (cyclotomic (↑n) K) L) = adjoin K {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1}
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L`
obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n)
/-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L`
Mathlib.NumberTheory.Cyclotomic.Basic.497_0.xReI1DeVvechFQU
/-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K)
Mathlib_NumberTheory_Cyclotomic_Basic
case intro n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : IsCyclotomicExtension {n} K L this : DecidableEq L := Classical.decEq L ζ : L hζ : IsPrimitiveRoot ζ ↑n ⊢ adjoin K (rootSet (cyclotomic (↑n) K) L) = adjoin K {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1}
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n)
exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ
/-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n)
Mathlib.NumberTheory.Cyclotomic.Basic.497_0.xReI1DeVvechFQU
/-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁵ : CommRing A inst✝⁴ : CommRing B inst✝³ : Algebra A B inst✝² : Field K inst✝¹ : Field L inst✝ : Algebra K L ⊢ Field (CyclotomicField n K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by
delta CyclotomicField
instance : Field (CyclotomicField n K) := by
Mathlib.NumberTheory.Cyclotomic.Basic.528_0.xReI1DeVvechFQU
instance : Field (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁵ : CommRing A inst✝⁴ : CommRing B inst✝³ : Algebra A B inst✝² : Field K inst✝¹ : Field L inst✝ : Algebra K L ⊢ Field (SplittingField (cyclotomic (↑n) K))
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField;
infer_instance
instance : Field (CyclotomicField n K) := by delta CyclotomicField;
Mathlib.NumberTheory.Cyclotomic.Basic.528_0.xReI1DeVvechFQU
instance : Field (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁵ : CommRing A inst✝⁴ : CommRing B inst✝³ : Algebra A B inst✝² : Field K inst✝¹ : Field L inst✝ : Algebra K L ⊢ Algebra K (CyclotomicField n K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by
delta CyclotomicField
instance algebra : Algebra K (CyclotomicField n K) := by
Mathlib.NumberTheory.Cyclotomic.Basic.532_0.xReI1DeVvechFQU
instance algebra : Algebra K (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁵ : CommRing A inst✝⁴ : CommRing B inst✝³ : Algebra A B inst✝² : Field K inst✝¹ : Field L inst✝ : Algebra K L ⊢ Algebra K (SplittingField (cyclotomic (↑n) K))
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField;
infer_instance
instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField;
Mathlib.NumberTheory.Cyclotomic.Basic.532_0.xReI1DeVvechFQU
instance algebra : Algebra K (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁵ : CommRing A inst✝⁴ : CommRing B inst✝³ : Algebra A B inst✝² : Field K inst✝¹ : Field L inst✝ : Algebra K L ⊢ Inhabited (CyclotomicField n K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by
delta CyclotomicField
instance : Inhabited (CyclotomicField n K) := by
Mathlib.NumberTheory.Cyclotomic.Basic.536_0.xReI1DeVvechFQU
instance : Inhabited (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁵ : CommRing A inst✝⁴ : CommRing B inst✝³ : Algebra A B inst✝² : Field K inst✝¹ : Field L inst✝ : Algebra K L ⊢ Inhabited (SplittingField (cyclotomic (↑n) K))
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField;
infer_instance
instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField;
Mathlib.NumberTheory.Cyclotomic.Basic.536_0.xReI1DeVvechFQU
instance : Inhabited (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : NeZero ↑↑n ⊢ IsCyclotomicExtension {n} K (CyclotomicField n K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by
haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by
Mathlib.NumberTheory.Cyclotomic.Basic.542_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : NeZero ↑↑n this : NeZero ↑↑n ⊢ IsCyclotomicExtension {n} K (CyclotomicField n K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective
letI := Classical.decEq (CyclotomicField n K)
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective
Mathlib.NumberTheory.Cyclotomic.Basic.542_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : NeZero ↑↑n this✝ : NeZero ↑↑n this : DecidableEq (CyclotomicField n K) := Classical.decEq (CyclotomicField n K) ⊢ IsCyclotomicExtension {n} K (CyclotomicField n K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K)
obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne'
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K)
Mathlib.NumberTheory.Cyclotomic.Basic.542_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
case intro n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : NeZero ↑↑n this✝ : NeZero ↑↑n this : DecidableEq (CyclotomicField n K) := Classical.decEq (CyclotomicField n K) ζ : CyclotomicField n K hζ : eval₂ (algebraMap K (CyclotomicField n K)) ζ (cyclotomic (↑n) K) = 0 ⊢ IsCyclotomicExtension {n} K (CyclotomicField n K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne'
rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne'
Mathlib.NumberTheory.Cyclotomic.Basic.542_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
case intro n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : NeZero ↑↑n this✝ : NeZero ↑↑n this : DecidableEq (CyclotomicField n K) := Classical.decEq (CyclotomicField n K) ζ : CyclotomicField n K hζ : IsPrimitiveRoot ζ ↑n ⊢ IsCyclotomicExtension {n} K (CyclotomicField n K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails.
refine ⟨?_, ?_⟩
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails.
Mathlib.NumberTheory.Cyclotomic.Basic.542_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
case intro.refine_1 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : NeZero ↑↑n this✝ : NeZero ↑↑n this : DecidableEq (CyclotomicField n K) := Classical.decEq (CyclotomicField n K) ζ : CyclotomicField n K hζ : IsPrimitiveRoot ζ ↑n ⊢ ∀ {n_1 : ℕ+}, n_1 ∈ {n} → ∃ r, IsPrimitiveRoot r ↑n_1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ ·
simp only [mem_singleton_iff, forall_eq]
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ ·
Mathlib.NumberTheory.Cyclotomic.Basic.542_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
case intro.refine_1 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : NeZero ↑↑n this✝ : NeZero ↑↑n this : DecidableEq (CyclotomicField n K) := Classical.decEq (CyclotomicField n K) ζ : CyclotomicField n K hζ : IsPrimitiveRoot ζ ↑n ⊢ ∃ r, IsPrimitiveRoot r ↑n
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq]
exact ⟨ζ, hζ⟩
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq]
Mathlib.NumberTheory.Cyclotomic.Basic.542_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
case intro.refine_2 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : NeZero ↑↑n this✝ : NeZero ↑↑n this : DecidableEq (CyclotomicField n K) := Classical.decEq (CyclotomicField n K) ζ : CyclotomicField n K hζ : IsPrimitiveRoot ζ ↑n ⊢ ∀ (x : CyclotomicField n K), x ∈ adjoin K {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1}
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ ·
rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm]
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ ·
Mathlib.NumberTheory.Cyclotomic.Basic.542_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
case intro.refine_2 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : NeZero ↑↑n this✝ : NeZero ↑↑n this : DecidableEq (CyclotomicField n K) := Classical.decEq (CyclotomicField n K) ζ : CyclotomicField n K hζ : IsPrimitiveRoot ζ ↑n ⊢ adjoin K (rootSet (cyclotomic (↑n) K) (SplittingField (cyclotomic (↑n) K))) = adjoin K {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1}
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm]
exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm]
Mathlib.NumberTheory.Cyclotomic.Basic.542_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁷ : CommRing A inst✝⁶ : CommRing B inst✝⁵ : Algebra A B inst✝⁴ : Field K inst✝³ : Field L inst✝² : Algebra K L inst✝¹ : Algebra A K inst✝ : IsFractionRing A K ⊢ NoZeroSMulDivisors A (CyclotomicField n K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by
refine' NoZeroSMulDivisors.of_algebraMap_injective _
instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by
Mathlib.NumberTheory.Cyclotomic.Basic.588_0.xReI1DeVvechFQU
instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁷ : CommRing A inst✝⁶ : CommRing B inst✝⁵ : Algebra A B inst✝⁴ : Field K inst✝³ : Field L inst✝² : Algebra K L inst✝¹ : Algebra A K inst✝ : IsFractionRing A K ⊢ Function.Injective ⇑(algebraMap A (CyclotomicField n K))
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _
rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)]
instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _
Mathlib.NumberTheory.Cyclotomic.Basic.588_0.xReI1DeVvechFQU
instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁷ : CommRing A inst✝⁶ : CommRing B inst✝⁵ : Algebra A B inst✝⁴ : Field K inst✝³ : Field L inst✝² : Algebra K L inst✝¹ : Algebra A K inst✝ : IsFractionRing A K ⊢ Function.Injective ⇑(RingHom.comp (algebraMap K (CyclotomicField n K)) (algebraMap A K))
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)]
exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _)
instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)]
Mathlib.NumberTheory.Cyclotomic.Basic.588_0.xReI1DeVvechFQU
instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁷ : CommRing A inst✝⁶ : CommRing B inst✝⁵ : Algebra A B inst✝⁴ : Field K inst✝³ : Field L inst✝² : Algebra K L inst✝¹ : Algebra A K inst✝ : IsFractionRing A K ⊢ CommRing (CyclotomicRing n A K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by
delta CyclotomicRing
instance : CommRing (CyclotomicRing n A K) := by
Mathlib.NumberTheory.Cyclotomic.Basic.608_0.xReI1DeVvechFQU
instance : CommRing (CyclotomicRing n A K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁷ : CommRing A inst✝⁶ : CommRing B inst✝⁵ : Algebra A B inst✝⁴ : Field K inst✝³ : Field L inst✝² : Algebra K L inst✝¹ : Algebra A K inst✝ : IsFractionRing A K ⊢ CommRing ↥(adjoin A {b | b ^ ↑n = 1})
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing;
infer_instance
instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing;
Mathlib.NumberTheory.Cyclotomic.Basic.608_0.xReI1DeVvechFQU
instance : CommRing (CyclotomicRing n A K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁷ : CommRing A inst✝⁶ : CommRing B inst✝⁵ : Algebra A B inst✝⁴ : Field K inst✝³ : Field L inst✝² : Algebra K L inst✝¹ : Algebra A K inst✝ : IsFractionRing A K ⊢ IsDomain (CyclotomicRing n A K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by
delta CyclotomicRing
instance : IsDomain (CyclotomicRing n A K) := by
Mathlib.NumberTheory.Cyclotomic.Basic.612_0.xReI1DeVvechFQU
instance : IsDomain (CyclotomicRing n A K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁷ : CommRing A inst✝⁶ : CommRing B inst✝⁵ : Algebra A B inst✝⁴ : Field K inst✝³ : Field L inst✝² : Algebra K L inst✝¹ : Algebra A K inst✝ : IsFractionRing A K ⊢ IsDomain ↥(adjoin A {b | b ^ ↑n = 1})
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing;
infer_instance
instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing;
Mathlib.NumberTheory.Cyclotomic.Basic.612_0.xReI1DeVvechFQU
instance : IsDomain (CyclotomicRing n A K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁷ : CommRing A inst✝⁶ : CommRing B inst✝⁵ : Algebra A B inst✝⁴ : Field K inst✝³ : Field L inst✝² : Algebra K L inst✝¹ : Algebra A K inst✝ : IsFractionRing A K ⊢ Inhabited (CyclotomicRing n A K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by
delta CyclotomicRing
instance : Inhabited (CyclotomicRing n A K) := by
Mathlib.NumberTheory.Cyclotomic.Basic.616_0.xReI1DeVvechFQU
instance : Inhabited (CyclotomicRing n A K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁷ : CommRing A inst✝⁶ : CommRing B inst✝⁵ : Algebra A B inst✝⁴ : Field K inst✝³ : Field L inst✝² : Algebra K L inst✝¹ : Algebra A K inst✝ : IsFractionRing A K ⊢ Inhabited ↥(adjoin A {b | b ^ ↑n = 1})
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing;
infer_instance
instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing;
Mathlib.NumberTheory.Cyclotomic.Basic.616_0.xReI1DeVvechFQU
instance : Inhabited (CyclotomicRing n A K)
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n a : ℕ+ han : a ∈ {n} ⊢ ∃ r, IsPrimitiveRoot r ↑a
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by
rw [mem_singleton_iff] at han
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n a : ℕ+ han : a = n ⊢ ∃ r, IsPrimitiveRoot r ↑a
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han
subst a
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n ⊢ ∃ r, IsPrimitiveRoot r ↑n
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a
haveI := NeZero.of_noZeroSMulDivisors A K n
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n this : NeZero ↑↑n ⊢ ∃ r, IsPrimitiveRoot r ↑n
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n
haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n this✝ : NeZero ↑↑n this : NeZero ↑↑n ⊢ ∃ r, IsPrimitiveRoot r ↑n
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n
obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n)
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
case intro n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n this✝ : NeZero ↑↑n this : NeZero ↑↑n μ : CyclotomicField n K hμ : IsPrimitiveRoot μ ↑n ⊢ ∃ r, IsPrimitiveRoot r ↑n
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n)
refine' ⟨⟨μ, subset_adjoin _⟩, _⟩
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n)
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
case intro.refine'_1 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n this✝ : NeZero ↑↑n this : NeZero ↑↑n μ : CyclotomicField n K hμ : IsPrimitiveRoot μ ↑n ⊢ μ ∈ {b | b ^ ↑n = 1}
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ ·
apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ ·
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
case intro.refine'_1 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n this✝ : NeZero ↑↑n this : NeZero ↑↑n μ : CyclotomicField n K hμ : IsPrimitiveRoot μ ↑n ⊢ ∃ i ∈ Nat.divisors ↑n, IsRoot (cyclotomic i (CyclotomicField n K)) μ
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr
refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
case intro.refine'_1 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n this✝ : NeZero ↑↑n this : NeZero ↑↑n μ : CyclotomicField n K hμ : IsPrimitiveRoot μ ↑n ⊢ IsRoot (cyclotomic (↑n) (CyclotomicField n K)) μ
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩
rwa [← isRoot_cyclotomic_iff] at hμ
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
case intro.refine'_2 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n this✝ : NeZero ↑↑n this : NeZero ↑↑n μ : CyclotomicField n K hμ : IsPrimitiveRoot μ ↑n ⊢ IsPrimitiveRoot { val := μ, property := (_ : μ ∈ ↑(adjoin A {b | b ^ ↑n = 1})) } ↑n
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ ·
rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk]
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ ·
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n x : CyclotomicRing n A K ⊢ x ∈ adjoin A {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1}
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by
refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
case refine'_1 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n x : CyclotomicRing n A K y : CyclotomicField n K hy : y ∈ {b | b ^ ↑n = 1} ⊢ { val := y, property := (_ : y ∈ ↑(adjoin A {b | b ^ ↑n = 1})) } ∈ adjoin A {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1}
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x ·
refine' subset_adjoin _
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x ·
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
case refine'_1 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n x : CyclotomicRing n A K y : CyclotomicField n K hy : y ∈ {b | b ^ ↑n = 1} ⊢ { val := y, property := (_ : y ∈ ↑(adjoin A {b | b ^ ↑n = 1})) } ∈ {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1}
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _
simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq]
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
case refine'_1 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n x : CyclotomicRing n A K y : CyclotomicField n K hy : y ∈ {b | b ^ ↑n = 1} ⊢ { val := y, property := (_ : y ∈ ↑(adjoin A {b | b ^ ↑n = 1})) } ^ ↑n = 1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq]
rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk]
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq]
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
case refine'_2 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n x : CyclotomicRing n A K a : A ⊢ (algebraMap A ↥(adjoin A {b | b ^ ↑n = 1})) a ∈ adjoin A {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1}
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] ·
exact Subalgebra.algebraMap_mem _ a
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] ·
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
case refine'_3 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n x : CyclotomicRing n A K y z : ↥(adjoin A {b | b ^ ↑n = 1}) hy : y ∈ adjoin A {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1} hz : z ∈ adjoin A {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1} ⊢ y + z ∈ adjoin A {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1}
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a ·
exact Subalgebra.add_mem _ hy hz
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a ·
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
case refine'_4 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁸ : CommRing A inst✝⁷ : CommRing B inst✝⁶ : Algebra A B inst✝⁵ : Field K inst✝⁴ : Field L inst✝³ : Algebra K L inst✝² : Algebra A K inst✝¹ : IsFractionRing A K inst✝ : NeZero ↑↑n x : CyclotomicRing n A K y z : ↥(adjoin A {b | b ^ ↑n = 1}) hy : y ∈ adjoin A {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1} hz : z ∈ adjoin A {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1} ⊢ y * z ∈ adjoin A {b | ∃ n_1 ∈ {n}, b ^ ↑n_1 = 1}
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz ·
exact Subalgebra.mul_mem _ hy hz
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz ·
Mathlib.NumberTheory.Cyclotomic.Basic.649_0.xReI1DeVvechFQU
instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x✝ : ↥(nonZeroDivisors (CyclotomicRing n A K)) x : CyclotomicRing n A K hx : x ∈ nonZeroDivisors (CyclotomicRing n A K) ⊢ IsUnit ((algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑{ val := x, property := hx })
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by
rw [isUnit_iff_ne_zero]
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x✝ : ↥(nonZeroDivisors (CyclotomicRing n A K)) x : CyclotomicRing n A K hx : x ∈ nonZeroDivisors (CyclotomicRing n A K) ⊢ (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑{ val := x, property := hx } ≠ 0
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero]
apply map_ne_zero_of_mem_nonZeroDivisors
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero]
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case hg n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x✝ : ↥(nonZeroDivisors (CyclotomicRing n A K)) x : CyclotomicRing n A K hx : x ∈ nonZeroDivisors (CyclotomicRing n A K) ⊢ Function.Injective ⇑(algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) case h n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x✝ : ↥(nonZeroDivisors (CyclotomicRing n A K)) x : CyclotomicRing n A K hx : x ∈ nonZeroDivisors (CyclotomicRing n A K) ⊢ ↑{ val := x, property := hx } ∈ nonZeroDivisors (CyclotomicRing n A K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors
apply adjoin_algebra_injective
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case h n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x✝ : ↥(nonZeroDivisors (CyclotomicRing n A K)) x : CyclotomicRing n A K hx : x ∈ nonZeroDivisors (CyclotomicRing n A K) ⊢ ↑{ val := x, property := hx } ∈ nonZeroDivisors (CyclotomicRing n A K)
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective
exact hx
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K ⊢ ∃ x_1, x * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x_1.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x_1.1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by
letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K)
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) ⊢ ∃ x_1, x * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x_1.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x_1.1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K)
refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K)
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_1 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) y : CyclotomicField n K hy : y ∈ {b | b ^ ↑n = 1} ⊢ ∃ x, y * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x.1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. ·
exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. ·
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) y : CyclotomicField n K hy : y ∈ {b | b ^ ↑n = 1} ⊢ y * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑({ val := y, property := (_ : y ∈ ↑(adjoin A {b | b ^ ↑n = 1})) }, 1).2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ({ val := y, property := (_ : y ∈ ↑(adjoin A {b | b ^ ↑n = 1})) }, 1).1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by
simp
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) y : CyclotomicField n K hy : y ∈ {b | b ^ ↑n = 1} ⊢ y = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) { val := y, property := (_ : y ∈ ↑(adjoin A {b | b ^ ↑n = 1})) }
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp;
rfl
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp;
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_2 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) k : K ⊢ ∃ x, (algebraMap K (CyclotomicField n K)) k * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x.1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ ·
have : IsLocalization (nonZeroDivisors A) K := inferInstance
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ ·
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_2 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this✝ : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) k : K this : IsLocalization (nonZeroDivisors A) K ⊢ ∃ x, (algebraMap K (CyclotomicField n K)) k * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x.1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance
replace := this.surj
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_2 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this✝ : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) k : K this : ∀ (z : K), ∃ x, z * (algebraMap A K) ↑x.2 = (algebraMap A K) x.1 ⊢ ∃ x, (algebraMap K (CyclotomicField n K)) k * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x.1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj
obtain ⟨⟨z, w⟩, hw⟩ := this k
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_2.intro.mk n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this✝ : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) k : K this : ∀ (z : K), ∃ x, z * (algebraMap A K) ↑x.2 = (algebraMap A K) x.1 z : A w : ↥(nonZeroDivisors A) hw : k * (algebraMap A K) ↑(z, w).2 = (algebraMap A K) (z, w).1 ⊢ ∃ x, (algebraMap K (CyclotomicField n K)) k * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x.1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k
refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_2.intro.mk n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this✝ : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) k : K this : ∀ (z : K), ∃ x, z * (algebraMap A K) ↑x.2 = (algebraMap A K) x.1 z : A w : ↥(nonZeroDivisors A) hw : k * (algebraMap A K) ↑(z, w).2 = (algebraMap A K) (z, w).1 ⊢ (algebraMap K (CyclotomicField n K)) k * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑((algebraMap A (CyclotomicRing n A K)) z, { val := (algebraMap A (CyclotomicRing n A K)) ↑w, property := (_ : (algebraMap A (CyclotomicRing n A K)) ↑w ∈ nonZeroDivisors (CyclotomicRing n A K)) }).2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ((algebraMap A (CyclotomicRing n A K)) z, { val := (algebraMap A (CyclotomicRing n A K)) ↑w, property := (_ : (algebraMap A (CyclotomicRing n A K)) ↑w ∈ nonZeroDivisors (CyclotomicRing n A K)) }).1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩
letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl)
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_2.intro.mk n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this✝¹ : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) k : K this✝ : ∀ (z : K), ∃ x, z * (algebraMap A K) ↑x.2 = (algebraMap A K) x.1 z : A w : ↥(nonZeroDivisors A) hw : k * (algebraMap A K) ↑(z, w).2 = (algebraMap A K) (z, w).1 this : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) ⊢ (algebraMap K (CyclotomicField n K)) k * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑((algebraMap A (CyclotomicRing n A K)) z, { val := (algebraMap A (CyclotomicRing n A K)) ↑w, property := (_ : (algebraMap A (CyclotomicRing n A K)) ↑w ∈ nonZeroDivisors (CyclotomicRing n A K)) }).2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ((algebraMap A (CyclotomicRing n A K)) z, { val := (algebraMap A (CyclotomicRing n A K)) ↑w, property := (_ : (algebraMap A (CyclotomicRing n A K)) ↑w ∈ nonZeroDivisors (CyclotomicRing n A K)) }).1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl)
rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply]
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl)
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_3 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) ⊢ ∀ (x y : CyclotomicField n K), (∃ x_1, x * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x_1.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x_1.1) → (∃ x, y * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x.1) → ∃ x_1, (x + y) * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x_1.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x_1.1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] ·
rintro y z ⟨a, ha⟩ ⟨b, hb⟩
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] ·
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_3.intro.intro n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) y z : CyclotomicField n K a : CyclotomicRing n A K × ↥(nonZeroDivisors (CyclotomicRing n A K)) ha : y * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑a.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) a.1 b : CyclotomicRing n A K × ↥(nonZeroDivisors (CyclotomicRing n A K)) hb : z * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑b.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) b.1 ⊢ ∃ x, (y + z) * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x.1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩
refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_3.intro.intro n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) y z : CyclotomicField n K a : CyclotomicRing n A K × ↥(nonZeroDivisors (CyclotomicRing n A K)) ha : y * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑a.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) a.1 b : CyclotomicRing n A K × ↥(nonZeroDivisors (CyclotomicRing n A K)) hb : z * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑b.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) b.1 ⊢ (y + z) * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑(a.1 * ↑b.2 + b.1 * ↑a.2, { val := ↑a.2 * ↑b.2, property := (_ : ↑a.2 * ↑b.2 ∈ nonZeroDivisors (CyclotomicRing n A K)) }).2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) (a.1 * ↑b.2 + b.1 * ↑a.2, { val := ↑a.2 * ↑b.2, property := (_ : ↑a.2 * ↑b.2 ∈ nonZeroDivisors (CyclotomicRing n A K)) }).1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩
rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb]
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_3.intro.intro n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) y z : CyclotomicField n K a : CyclotomicRing n A K × ↥(nonZeroDivisors (CyclotomicRing n A K)) ha : y * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑a.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) a.1 b : CyclotomicRing n A K × ↥(nonZeroDivisors (CyclotomicRing n A K)) hb : z * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑b.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) b.1 ⊢ (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) a.1 * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑b.2 + (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) b.1 * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑a.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) (a.1 * ↑b.2 + b.1 * ↑a.2, { val := ↑a.2 * ↑b.2, property := (_ : ↑a.2 * ↑b.2 ∈ nonZeroDivisors (CyclotomicRing n A K)) }).1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb]
simp only [map_add, map_mul]
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb]
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_4 n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) ⊢ ∀ (x y : CyclotomicField n K), (∃ x_1, x * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x_1.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x_1.1) → (∃ x, y * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x.1) → ∃ x_1, x * y * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x_1.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x_1.1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] ·
rintro y z ⟨a, ha⟩ ⟨b, hb⟩
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] ·
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_4.intro.intro n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) y z : CyclotomicField n K a : CyclotomicRing n A K × ↥(nonZeroDivisors (CyclotomicRing n A K)) ha : y * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑a.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) a.1 b : CyclotomicRing n A K × ↥(nonZeroDivisors (CyclotomicRing n A K)) hb : z * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑b.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) b.1 ⊢ ∃ x, y * z * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑x.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x.1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩
refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_4.intro.intro n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) y z : CyclotomicField n K a : CyclotomicRing n A K × ↥(nonZeroDivisors (CyclotomicRing n A K)) ha : y * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑a.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) a.1 b : CyclotomicRing n A K × ↥(nonZeroDivisors (CyclotomicRing n A K)) hb : z * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑b.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) b.1 ⊢ y * z * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑(a.1 * b.1, { val := ↑a.2 * ↑b.2, property := (_ : ↑a.2 * ↑b.2 ∈ nonZeroDivisors (CyclotomicRing n A K)) }).2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) (a.1 * b.1, { val := ↑a.2 * ↑b.2, property := (_ : ↑a.2 * ↑b.2 ∈ nonZeroDivisors (CyclotomicRing n A K)) }).1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩
rw [RingHom.map_mul, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), mul_assoc, ← mul_assoc z, hb, ← mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, ha]
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
case refine_4.intro.intro n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x : CyclotomicField n K this : NeZero ↑↑n := NeZero.nat_of_injective (IsFractionRing.injective A K) y z : CyclotomicField n K a : CyclotomicRing n A K × ↥(nonZeroDivisors (CyclotomicRing n A K)) ha : y * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑a.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) a.1 b : CyclotomicRing n A K × ↥(nonZeroDivisors (CyclotomicRing n A K)) hb : z * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) ↑b.2 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) b.1 ⊢ (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) a.1 * (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) b.1 = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) (a.1 * b.1, { val := ↑a.2 * ↑b.2, property := (_ : ↑a.2 * ↑b.2 ∈ nonZeroDivisors (CyclotomicRing n A K)) }).1
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), mul_assoc, ← mul_assoc z, hb, ← mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, ha]
simp only [map_mul]
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), mul_assoc, ← mul_assoc z, hb, ← mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, ha]
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁹ : CommRing A inst✝⁸ : CommRing B inst✝⁷ : Algebra A B inst✝⁶ : Field K inst✝⁵ : Field L inst✝⁴ : Algebra K L inst✝³ : Algebra A K inst✝² : IsFractionRing A K inst✝¹ : IsDomain A inst✝ : NeZero ↑↑n x y : CyclotomicRing n A K h : (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) x = (algebraMap (CyclotomicRing n A K) (CyclotomicField n K)) y ⊢ ↑1 * x = ↑1 * y
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), mul_assoc, ← mul_assoc z, hb, ← mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, ha] simp only [map_mul] exists_of_eq {x y} h := ⟨1, by
rw [adjoin_algebra_injective n A K h]
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), mul_assoc, ← mul_assoc z, hb, ← mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, ha] simp only [map_mul] exists_of_eq {x y} h := ⟨1, by
Mathlib.NumberTheory.Cyclotomic.Basic.673_0.xReI1DeVvechFQU
instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units'
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁷ : CommRing A inst✝⁶ : CommRing B inst✝⁵ : Algebra A B inst✝⁴ : Field K inst✝³ : Field L inst✝² : Algebra K L inst✝¹ : Algebra A K inst✝ : IsFractionRing A K μ : CyclotomicField n K h : IsPrimitiveRoot μ ↑n ⊢ CyclotomicRing n A K = ↥(adjoin A {μ})
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), mul_assoc, ← mul_assoc z, hb, ← mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, ha] simp only [map_mul] exists_of_eq {x y} h := ⟨1, by rw [adjoin_algebra_injective n A K h]⟩ theorem eq_adjoin_primitive_root {μ : CyclotomicField n K} (h : IsPrimitiveRoot μ n) : CyclotomicRing n A K = adjoin A ({μ} : Set (CyclotomicField n K)) := by
rw [← IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic h, IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots h]
theorem eq_adjoin_primitive_root {μ : CyclotomicField n K} (h : IsPrimitiveRoot μ n) : CyclotomicRing n A K = adjoin A ({μ} : Set (CyclotomicField n K)) := by
Mathlib.NumberTheory.Cyclotomic.Basic.712_0.xReI1DeVvechFQU
theorem eq_adjoin_primitive_root {μ : CyclotomicField n K} (h : IsPrimitiveRoot μ n) : CyclotomicRing n A K = adjoin A ({μ} : Set (CyclotomicField n K))
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁷ : CommRing A inst✝⁶ : CommRing B inst✝⁵ : Algebra A B inst✝⁴ : Field K inst✝³ : Field L inst✝² : Algebra K L inst✝¹ : Algebra A K inst✝ : IsFractionRing A K μ : CyclotomicField n K h : IsPrimitiveRoot μ ↑n ⊢ CyclotomicRing n A K = ↥(adjoin A {b | ∃ a ∈ {n}, b ^ ↑a = 1})
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), mul_assoc, ← mul_assoc z, hb, ← mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, ha] simp only [map_mul] exists_of_eq {x y} h := ⟨1, by rw [adjoin_algebra_injective n A K h]⟩ theorem eq_adjoin_primitive_root {μ : CyclotomicField n K} (h : IsPrimitiveRoot μ n) : CyclotomicRing n A K = adjoin A ({μ} : Set (CyclotomicField n K)) := by rw [← IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic h, IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots h]
simp [CyclotomicRing]
theorem eq_adjoin_primitive_root {μ : CyclotomicField n K} (h : IsPrimitiveRoot μ n) : CyclotomicRing n A K = adjoin A ({μ} : Set (CyclotomicField n K)) := by rw [← IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic h, IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots h]
Mathlib.NumberTheory.Cyclotomic.Basic.712_0.xReI1DeVvechFQU
theorem eq_adjoin_primitive_root {μ : CyclotomicField n K} (h : IsPrimitiveRoot μ n) : CyclotomicRing n A K = adjoin A ({μ} : Set (CyclotomicField n K))
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : IsAlgClosed K h : ∀ a ∈ S, NeZero ↑↑a ⊢ IsCyclotomicExtension S K K
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), mul_assoc, ← mul_assoc z, hb, ← mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, ha] simp only [map_mul] exists_of_eq {x y} h := ⟨1, by rw [adjoin_algebra_injective n A K h]⟩ theorem eq_adjoin_primitive_root {μ : CyclotomicField n K} (h : IsPrimitiveRoot μ n) : CyclotomicRing n A K = adjoin A ({μ} : Set (CyclotomicField n K)) := by rw [← IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic h, IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots h] simp [CyclotomicRing] #align cyclotomic_ring.eq_adjoin_primitive_root CyclotomicRing.eq_adjoin_primitive_root end CyclotomicRing end CyclotomicRing end IsDomain section IsAlgClosed variable [IsAlgClosed K] /-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K := by
refine' ⟨@fun a ha => _, Algebra.eq_top_iff.mp <| Subsingleton.elim _ _⟩
/-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K := by
Mathlib.NumberTheory.Cyclotomic.Basic.729_0.xReI1DeVvechFQU
/-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K
Mathlib_NumberTheory_Cyclotomic_Basic
n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : IsAlgClosed K h : ∀ a ∈ S, NeZero ↑↑a a : ℕ+ ha : a ∈ S ⊢ ∃ r, IsPrimitiveRoot r ↑a
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), mul_assoc, ← mul_assoc z, hb, ← mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, ha] simp only [map_mul] exists_of_eq {x y} h := ⟨1, by rw [adjoin_algebra_injective n A K h]⟩ theorem eq_adjoin_primitive_root {μ : CyclotomicField n K} (h : IsPrimitiveRoot μ n) : CyclotomicRing n A K = adjoin A ({μ} : Set (CyclotomicField n K)) := by rw [← IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic h, IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots h] simp [CyclotomicRing] #align cyclotomic_ring.eq_adjoin_primitive_root CyclotomicRing.eq_adjoin_primitive_root end CyclotomicRing end CyclotomicRing end IsDomain section IsAlgClosed variable [IsAlgClosed K] /-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K := by refine' ⟨@fun a ha => _, Algebra.eq_top_iff.mp <| Subsingleton.elim _ _⟩
obtain ⟨r, hr⟩ := IsAlgClosed.exists_aeval_eq_zero K _ (degree_cyclotomic_pos a K a.pos).ne'
/-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K := by refine' ⟨@fun a ha => _, Algebra.eq_top_iff.mp <| Subsingleton.elim _ _⟩
Mathlib.NumberTheory.Cyclotomic.Basic.729_0.xReI1DeVvechFQU
/-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K
Mathlib_NumberTheory_Cyclotomic_Basic
case intro n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : IsAlgClosed K h : ∀ a ∈ S, NeZero ↑↑a a : ℕ+ ha : a ∈ S r : K hr : (aeval r) (cyclotomic (↑a) K) = 0 ⊢ ∃ r, IsPrimitiveRoot r ↑a
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), mul_assoc, ← mul_assoc z, hb, ← mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, ha] simp only [map_mul] exists_of_eq {x y} h := ⟨1, by rw [adjoin_algebra_injective n A K h]⟩ theorem eq_adjoin_primitive_root {μ : CyclotomicField n K} (h : IsPrimitiveRoot μ n) : CyclotomicRing n A K = adjoin A ({μ} : Set (CyclotomicField n K)) := by rw [← IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic h, IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots h] simp [CyclotomicRing] #align cyclotomic_ring.eq_adjoin_primitive_root CyclotomicRing.eq_adjoin_primitive_root end CyclotomicRing end CyclotomicRing end IsDomain section IsAlgClosed variable [IsAlgClosed K] /-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K := by refine' ⟨@fun a ha => _, Algebra.eq_top_iff.mp <| Subsingleton.elim _ _⟩ obtain ⟨r, hr⟩ := IsAlgClosed.exists_aeval_eq_zero K _ (degree_cyclotomic_pos a K a.pos).ne'
refine' ⟨r, _⟩
/-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K := by refine' ⟨@fun a ha => _, Algebra.eq_top_iff.mp <| Subsingleton.elim _ _⟩ obtain ⟨r, hr⟩ := IsAlgClosed.exists_aeval_eq_zero K _ (degree_cyclotomic_pos a K a.pos).ne'
Mathlib.NumberTheory.Cyclotomic.Basic.729_0.xReI1DeVvechFQU
/-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K
Mathlib_NumberTheory_Cyclotomic_Basic
case intro n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : IsAlgClosed K h : ∀ a ∈ S, NeZero ↑↑a a : ℕ+ ha : a ∈ S r : K hr : (aeval r) (cyclotomic (↑a) K) = 0 ⊢ IsPrimitiveRoot r ↑a
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), mul_assoc, ← mul_assoc z, hb, ← mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, ha] simp only [map_mul] exists_of_eq {x y} h := ⟨1, by rw [adjoin_algebra_injective n A K h]⟩ theorem eq_adjoin_primitive_root {μ : CyclotomicField n K} (h : IsPrimitiveRoot μ n) : CyclotomicRing n A K = adjoin A ({μ} : Set (CyclotomicField n K)) := by rw [← IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic h, IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots h] simp [CyclotomicRing] #align cyclotomic_ring.eq_adjoin_primitive_root CyclotomicRing.eq_adjoin_primitive_root end CyclotomicRing end CyclotomicRing end IsDomain section IsAlgClosed variable [IsAlgClosed K] /-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K := by refine' ⟨@fun a ha => _, Algebra.eq_top_iff.mp <| Subsingleton.elim _ _⟩ obtain ⟨r, hr⟩ := IsAlgClosed.exists_aeval_eq_zero K _ (degree_cyclotomic_pos a K a.pos).ne' refine' ⟨r, _⟩
haveI := h a ha
/-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K := by refine' ⟨@fun a ha => _, Algebra.eq_top_iff.mp <| Subsingleton.elim _ _⟩ obtain ⟨r, hr⟩ := IsAlgClosed.exists_aeval_eq_zero K _ (degree_cyclotomic_pos a K a.pos).ne' refine' ⟨r, _⟩
Mathlib.NumberTheory.Cyclotomic.Basic.729_0.xReI1DeVvechFQU
/-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K
Mathlib_NumberTheory_Cyclotomic_Basic
case intro n : ℕ+ S T : Set ℕ+ A : Type u B : Type v K : Type w L : Type z inst✝⁶ : CommRing A inst✝⁵ : CommRing B inst✝⁴ : Algebra A B inst✝³ : Field K inst✝² : Field L inst✝¹ : Algebra K L inst✝ : IsAlgClosed K h : ∀ a ∈ S, NeZero ↑↑a a : ℕ+ ha : a ∈ S r : K hr : (aeval r) (cyclotomic (↑a) K) = 0 this : NeZero ↑↑a ⊢ IsPrimitiveRoot r ↑a
/- Copyright (c) 2021 Riccardo Brasca. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Riccardo Brasca -/ import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" /-! # Cyclotomic extensions Let `A` and `B` be commutative rings with `Algebra A B`. For `S : Set ℕ+`, we define a class `IsCyclotomicExtension S A B` expressing the fact that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. ## Main definitions * `IsCyclotomicExtension S A B` : means that `B` is obtained from `A` by adding `n`-th primitive roots of unity, for all `n ∈ S`. * `CyclotomicField`: given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. * `CyclotomicRing` : if `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. ## Main results * `IsCyclotomicExtension.trans` : if `IsCyclotomicExtension S A B` and `IsCyclotomicExtension T B C`, then `IsCyclotomicExtension (S ∪ T) A C` if `Function.Injective (algebraMap B C)`. * `IsCyclotomicExtension.union_right` : given `IsCyclotomicExtension (S ∪ T) A B`, then `IsCyclotomicExtension T (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }) B`. * `IsCyclotomicExtension.union_left` : given `IsCyclotomicExtension T A B` and `S ⊆ T`, then `IsCyclotomicExtension S A (adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 })`. * `IsCyclotomicExtension.finite` : if `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. * `IsCyclotomicExtension.numberField` : a finite cyclotomic extension of a number field is a number field. * `IsCyclotomicExtension.splitting_field_X_pow_sub_one` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. * `IsCyclotomicExtension.splitting_field_cyclotomic` : if `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. ## Implementation details Our definition of `IsCyclotomicExtension` is very general, to allow rings of any characteristic and infinite extensions, but it will mainly be used in the case `S = {n}` and for integral domains. All results are in the `IsCyclotomicExtension` namespace. Note that some results, for example `IsCyclotomicExtension.trans`, `IsCyclotomicExtension.finite`, `IsCyclotomicExtension.numberField`, `IsCyclotomicExtension.finiteDimensional`, `IsCyclotomicExtension.isGalois` and `CyclotomicField.algebraBase` are lemmas, but they can be made local instances. Some of them are included in the `Cyclotomic` locale. -/ open Polynomial Algebra FiniteDimensional Set open scoped BigOperators universe u v w z variable (n : ℕ+) (S T : Set ℕ+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section /-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated over `A` by the roots of `X ^ n - 1`. -/ @[mk_iff] class IsCyclotomicExtension : Prop where /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/ exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/ adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic /-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/ theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top /-- A reformulation of `IsCyclotomicExtension` in the case `S` is a singleton. -/ theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (∃ r : B, IsPrimitiveRoot r n) ∧ ∀ x, x ∈ adjoin A {b : B | b ^ (n : ℕ) = 1} := by simp [IsCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton /-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/ theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤ := by simpa [Algebra.eq_top_iff, IsCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty /-- If `IsCyclotomicExtension {1} A B`, then the image of `A` in `B` equals `B`. -/ theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (⊥ : Subalgebra A B) = ⊤ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((IsCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension ∅ A B`. -/ theorem singleton_zero_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension ∅ A B := by -- Porting note: Lean3 is able to infer `A`. refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => _⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) /-- Transitivity of cyclotomic extensions. -/ theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S ∪ T) A C := by refine' ⟨fun hn => _, fun x => _⟩ · cases' hn with hn hn · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 hS).1 hn refine' ⟨algebraMap B C b, _⟩ exact hb.map_of_injective h · exact ((IsCyclotomicExtension_iff _ _ _).1 hT).1 hn · refine' adjoin_induction (((IsCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => _) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy · let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}).map f := ⟨b, ((IsCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine' adjoin_mono (fun y hy => _) hb obtain ⟨b₁, ⟨⟨n, hn⟩, h₁⟩⟩ := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality] theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by constructor · rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨ζ, hζ⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hζ.unique (IsPrimitiveRoot.of_subsingleton ζ) · rintro (rfl | rfl) -- Porting note: `R := A` was not needed. · exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ · rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊤)⟩ #align is_cyclotomic_extension.subsingleton_iff IsCyclotomicExtension.subsingleton_iff /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `S ∪ T`, then `B` is a cyclotomic extension of `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` given by roots of unity of order in `T`. -/ theorem union_right [h : IsCyclotomicExtension (S ∪ T) A B] : IsCyclotomicExtension T (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) B := by have : {b : B | ∃ n : ℕ+, n ∈ S ∪ T ∧ b ^ (n : ℕ) = 1} = {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} ∪ {b : B | ∃ n : ℕ+, n ∈ T ∧ b ^ (n : ℕ) = 1} := by refine' le_antisymm _ _ · rintro x ⟨n, hn₁ | hn₂, hnpow⟩ · left; exact ⟨n, hn₁, hnpow⟩ · right; exact ⟨n, hn₂, hnpow⟩ · rintro x (⟨n, hn⟩ | ⟨n, hn⟩) · exact ⟨n, Or.inl hn.1, hn.2⟩ · exact ⟨n, Or.inr hn.1, hn.2⟩ refine' ⟨fun hn => ((IsCyclotomicExtension_iff _ A _).1 h).1 (mem_union_right S hn), fun b => _⟩ replace h := ((IsCyclotomicExtension_iff _ _ _).1 h).2 b rwa [this, adjoin_union_eq_adjoin_adjoin, Subalgebra.mem_restrictScalars] at h #align is_cyclotomic_extension.union_right IsCyclotomicExtension.union_right /-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`, then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B` given by roots of unity of order in `S`. -/ theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) : IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1}) := by refine' ⟨@fun n hn => _, fun b => _⟩ · obtain ⟨b, hb⟩ := ((IsCyclotomicExtension_iff _ _ _).1 h).1 (hS hn) refine' ⟨⟨b, subset_adjoin ⟨n, hn, hb.pow_eq_one⟩⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] · convert mem_top (R := A) (x := b) rw [← adjoin_adjoin_coe_preimage, preimage_setOf_eq] norm_cast #align is_cyclotomic_extension.union_left IsCyclotomicExtension.union_left variable {n S} /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` implies `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem of_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) [H : IsCyclotomicExtension S A B] : IsCyclotomicExtension (S ∪ {n}) A B := by refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩ · rw [mem_union, mem_singleton_iff] at hs obtain hs | rfl := hs · exact H.exists_prim_root hs · obtain ⟨m, hm⟩ := hS obtain ⟨x, rfl⟩ := h m hm obtain ⟨ζ, hζ⟩ := H.exists_prim_root hm refine' ⟨ζ ^ (x : ℕ), _⟩ convert hζ.pow_of_dvd x.ne_zero (dvd_mul_left (x : ℕ) s) simp only [PNat.mul_coe, Nat.mul_div_left, PNat.pos] · refine' _root_.eq_top_iff.2 _ rw [← ((iff_adjoin_eq_top S A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, hm⟩ := hx exact ⟨m, ⟨Or.inr hm.1, hm.2⟩⟩ #align is_cyclotomic_extension.of_union_of_dvd IsCyclotomicExtension.of_union_of_dvd /-- If `∀ s ∈ S, n ∣ s` and `S` is not empty, then `IsCyclotomicExtension S A B` if and only if `IsCyclotomicExtension (S ∪ {n}) A B`. -/ theorem iff_union_of_dvd (h : ∀ s ∈ S, n ∣ s) (hS : S.Nonempty) : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {n}) A B := by refine' ⟨fun H => of_union_of_dvd A B h hS, fun H => (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => _, _⟩⟩ · exact H.exists_prim_root (subset_union_left _ _ hs) · rw [_root_.eq_top_iff, ← ((iff_adjoin_eq_top _ A B).1 H).2] refine' adjoin_mono fun x hx => _ simp only [union_singleton, mem_insert_iff, mem_setOf_eq] at hx ⊢ obtain ⟨m, rfl | hm, hxpow⟩ := hx · obtain ⟨y, hy⟩ := hS refine' ⟨y, ⟨hy, _⟩⟩ obtain ⟨z, rfl⟩ := h y hy simp only [PNat.mul_coe, pow_mul, hxpow, one_pow] · exact ⟨m, ⟨hm, hxpow⟩⟩ #align is_cyclotomic_extension.iff_union_of_dvd IsCyclotomicExtension.iff_union_of_dvd variable (n S) /-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/ theorem iff_union_singleton_one : IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B := by obtain hS | rfl := S.eq_empty_or_nonempty.symm · exact iff_union_of_dvd _ _ (fun s _ => one_dvd _) hS rw [empty_union] refine' ⟨fun H => _, fun H => _⟩ · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => ⟨1, by simp [mem_singleton_iff.1 hs]⟩, _⟩ simp [adjoin_singleton_one, empty] · refine' (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => (not_mem_empty s hs).elim, _⟩ simp [@singleton_one A B _ _ _ H] #align is_cyclotomic_extension.iff_union_singleton_one IsCyclotomicExtension.iff_union_singleton_one variable {A B} /-- If `(⊥ : SubAlgebra A B) = ⊤`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_bot_eq_top (h : (⊥ : Subalgebra A B) = ⊤) : IsCyclotomicExtension {1} A B := by convert (iff_union_singleton_one _ A _).1 (singleton_zero_of_bot_eq_top h) simp #align is_cyclotomic_extension.singleton_one_of_bot_eq_top IsCyclotomicExtension.singleton_one_of_bot_eq_top /-- If `Function.Surjective (algebraMap A B)`, then `IsCyclotomicExtension {1} A B`. -/ theorem singleton_one_of_algebraMap_bijective (h : Function.Surjective (algebraMap A B)) : IsCyclotomicExtension {1} A B := singleton_one_of_bot_eq_top (surjective_algebraMap_iff.1 h).symm #align is_cyclotomic_extension.singleton_one_of_algebra_map_bijective IsCyclotomicExtension.singleton_one_of_algebraMap_bijective variable (A B) /-- Given `(f : B ≃ₐ[A] C)`, if `IsCyclotomicExtension S A B` then `IsCyclotomicExtension S A C`. -/ protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective haveI : IsScalarTower A B C := IsScalarTower.of_ring_hom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) #align is_cyclotomic_extension.equiv IsCyclotomicExtension.equiv protected theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B) := by obtain ⟨⟨r, hr⟩, -⟩ := (iff_singleton n A B).1 h exact hr.neZero' #align is_cyclotomic_extension.ne_zero IsCyclotomicExtension.neZero protected theorem neZero' [IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : A) := by haveI := IsCyclotomicExtension.neZero n A B exact NeZero.nat_of_neZero (algebraMap A B) #align is_cyclotomic_extension.ne_zero' IsCyclotomicExtension.neZero' end Basic section Fintype theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] : Module.Finite A B := by classical rw [Module.finite_def, ← top_toSubmodule, ← ((iff_adjoin_eq_top _ _ _).1 h).2] refine' fg_adjoin_of_finite _ fun b hb => _ · simp only [mem_singleton_iff, exists_eq_left] have : {b : B | b ^ (n : ℕ) = 1} = (nthRoots n (1 : B)).toFinset := Set.ext fun x => ⟨fun h => by simpa using h, fun h => by simpa using h⟩ rw [this] exact (nthRoots (↑n) 1).toFinset.finite_toSet · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hb refine' ⟨X ^ (n : ℕ) - 1, ⟨monic_X_pow_sub_C _ n.pos.ne.symm, by simp [hb]⟩⟩ #align is_cyclotomic_extension.finite_of_singleton IsCyclotomicExtension.finite_of_singleton /-- If `S` is finite and `IsCyclotomicExtension S A B`, then `B` is a finite `A`-algebra. -/ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExtension S A B] : Module.Finite A B := by cases' nonempty_fintype S with h revert h₂ A B refine' Set.Finite.induction_on (Set.Finite.intro h) (fun A B => _) @fun n S _ _ H A B => _ · intro _ _ _ _ _ refine' Module.finite_def.2 ⟨({1} : Finset B), _⟩ simp [← top_toSubmodule, ← empty, toSubmodule_bot, Submodule.one_eq_span] · intro _ _ _ _ h haveI : IsCyclotomicExtension S A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) := union_left _ (insert n S) _ _ (subset_insert n S) haveI := H A (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) have : Module.Finite (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) B := by rw [← union_singleton] at h letI := @union_right S {n} A B _ _ _ h exact finite_of_singleton n _ _ exact Module.Finite.trans (adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}) _ #align is_cyclotomic_extension.finite IsCyclotomicExtension.finite /-- A cyclotomic finite extension of a number field is a number field. -/ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by haveI := charZero_of_injective_algebraMap (algebraMap K L).injective haveI := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } #align is_cyclotomic_extension.number_field IsCyclotomicExtension.numberField /-- A finite cyclotomic extension of an integral noetherian domain is integral -/ theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] : Algebra.IsIntegral A B := letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance #align is_cyclotomic_extension.integral IsCyclotomicExtension.integral /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ theorem finiteDimensional (C : Type z) [Finite S] [CommRing C] [Algebra K C] [IsDomain C] [IsCyclotomicExtension S K C] : FiniteDimensional K C := IsCyclotomicExtension.finite S K C #align is_cyclotomic_extension.finite_dimensional IsCyclotomicExtension.finiteDimensional end Fintype section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine' le_antisymm (adjoin_mono fun x hx => _) (adjoin_le fun x hx => _) · rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos refine' SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin _) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] refine' ⟨cyclotomic_ne_zero n B, hζ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ} := by refine' le_antisymm (adjoin_le fun x hx => _) (adjoin_mono fun x hx => _) · suffices hx : x ^ n.1 = 1 obtain ⟨i, _, rfl⟩ := hζ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ζ) _) refine' (isRoot_of_unity_iff n.pos B).2 _ refine' ⟨n, Nat.mem_divisors_self n n.ne_zero, _⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 · simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hζ.isRoot_cyclotomic n.pos) #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic theorem adjoin_primitive_root_eq_top {n : ℕ+} [IsDomain B] [h : IsCyclotomicExtension {n} A B] {ζ : B} (hζ : IsPrimitiveRoot ζ n) : adjoin A ({ζ} : Set B) = ⊤ := by classical rw [← adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic hζ] rw [adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ] exact ((iff_adjoin_eq_top {n} A B).mp h).2 #align is_cyclotomic_extension.adjoin_primitive_root_eq_top IsCyclotomicExtension.adjoin_primitive_root_eq_top variable (A) theorem _root_.IsPrimitiveRoot.adjoin_isCyclotomicExtension {ζ : B} {n : ℕ+} (h : IsPrimitiveRoot ζ n) : IsCyclotomicExtension {n} A (adjoin A ({ζ} : Set B)) := { exists_prim_root := fun hi => by rw [Set.mem_singleton_iff] at hi refine' ⟨⟨ζ, subset_adjoin <| Set.mem_singleton ζ⟩, _⟩ rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk, hi] adjoin_roots := fun x => by refine adjoin_induction' (x := x) (fun b hb => ?_) (fun a => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) (fun b₁ b₂ hb₁ hb₂ => ?_) · rw [Set.mem_singleton_iff] at hb refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq, hb] rw [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] exact ((IsPrimitiveRoot.iff_def ζ n).1 h).1 · exact Subalgebra.algebraMap_mem _ _ · exact Subalgebra.add_mem _ hb₁ hb₂ · exact Subalgebra.mul_mem _ hb₁ hb₂ } #align is_primitive_root.adjoin_is_cyclotomic_extension IsPrimitiveRoot.adjoin_isCyclotomicExtension end section Field variable {n S} /-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`.-/ theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (X ^ (n : ℕ) - 1) := by rw [← splits_id_iff_splits, Polynomial.map_sub, Polynomial.map_one, Polynomial.map_pow, Polynomial.map_X] obtain ⟨z, hz⟩ := ((IsCyclotomicExtension_iff _ _ _).1 H).1 hS exact X_pow_sub_one_splits hz set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splits_X_pow_sub_one IsCyclotomicExtension.splits_X_pow_sub_one /-- A cyclotomic extension splits `cyclotomic n K` if `n ∈ S` and `ne_zero (n : K)`.-/ theorem splits_cyclotomic [IsCyclotomicExtension S K L] (hS : n ∈ S) : Splits (algebraMap K L) (cyclotomic n K) := by refine' splits_of_splits_of_dvd _ (X_pow_sub_C_ne_zero n.pos _) (splits_X_pow_sub_one K L hS) _ use ∏ i : ℕ in (n : ℕ).properDivisors, Polynomial.cyclotomic i K rw [(eq_cyclotomic_iff n.pos _).1 rfl, RingHom.map_one] #align is_cyclotomic_extension.splits_cyclotomic IsCyclotomicExtension.splits_cyclotomic variable (n S) section Singleton variable [IsCyclotomicExtension {n} K L] /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/ theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1) := { splits' := splits_X_pow_sub_one K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] congr refine' Set.ext fun x => _ simp only [Polynomial.map_pow, mem_singleton_iff, Multiset.mem_toFinset, exists_eq_left, mem_setOf_eq, Polynomial.map_X, Polynomial.map_one, Finset.mem_coe, Polynomial.map_sub] simp only [mem_rootSet', map_sub, map_pow, aeval_one, aeval_X, sub_eq_zero, map_X, and_iff_right_iff_imp, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one] exact fun _ => X_pow_sub_C_ne_zero n.pos (1 : L) } set_option linter.uppercaseLean3 false in #align is_cyclotomic_extension.splitting_field_X_pow_sub_one IsCyclotomicExtension.isSplittingField_X_pow_sub_one /-- Any two `n`-th cyclotomic extensions are isomorphic. -/ def algEquiv (L' : Type*) [Field L'] [Algebra K L'] [IsCyclotomicExtension {n} K L'] : L ≃ₐ[K] L' := let h₁ := isSplittingField_X_pow_sub_one n K L let h₂ := isSplittingField_X_pow_sub_one n K L' (@IsSplittingField.algEquiv K L _ _ _ (X ^ (n : ℕ) - 1) h₁).trans (@IsSplittingField.algEquiv K L' _ _ _ (X ^ (n : ℕ) - 1) h₂).symm #align is_cyclotomic_extension.alg_equiv IsCyclotomicExtension.algEquiv scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.isSplittingField_X_pow_sub_one theorem isGalois : IsGalois K L := letI := isSplittingField_X_pow_sub_one n K L IsGalois.of_separable_splitting_field (X_pow_sub_one_separable_iff.2 (IsCyclotomicExtension.neZero' n K L).1) #align is_cyclotomic_extension.is_galois IsCyclotomicExtension.isGalois /-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] letI := Classical.decEq L -- todo: make `exists_prim_root` take an explicit `L` obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_prim_root K (B := L) (mem_singleton n) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } #align is_cyclotomic_extension.splitting_field_cyclotomic IsCyclotomicExtension.splitting_field_cyclotomic scoped[Cyclotomic] attribute [instance] IsCyclotomicExtension.splitting_field_cyclotomic end Singleton end Field end IsCyclotomicExtension section CyclotomicField /-- Given `n : ℕ+` and a field `K`, we define `CyclotomicField n K` as the splitting field of `cyclotomic n K`. If `n` is nonzero in `K`, it has the instance `IsCyclotomicExtension {n} K (CyclotomicField n K)`. -/ def CyclotomicField : Type w := (cyclotomic n K).SplittingField #align cyclotomic_field CyclotomicField namespace CyclotomicField --Porting note: could not be derived instance : Field (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance algebra : Algebra K (CyclotomicField n K) := by delta CyclotomicField; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicField n K) := by delta CyclotomicField; infer_instance instance [CharZero K] : CharZero (CyclotomicField n K) := charZero_of_injective_algebraMap (algebraMap K _).injective instance isCyclotomicExtension [NeZero ((n : ℕ) : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by haveI : NeZero ((n : ℕ) : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective letI := Classical.decEq (CyclotomicField n K) obtain ⟨ζ, hζ⟩ := exists_root_of_splits (algebraMap K (CyclotomicField n K)) (SplittingField.splits _) (degree_cyclotomic_pos n K n.pos).ne' rw [← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] at hζ -- Porting note: the first `?_` was `forall_eq.2 ⟨ζ, hζ⟩` that now fails. refine ⟨?_, ?_⟩ · simp only [mem_singleton_iff, forall_eq] exact ⟨ζ, hζ⟩ · rw [← Algebra.eq_top_iff, ← SplittingField.adjoin_rootSet, eq_comm] exact IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ #align cyclotomic_field.is_cyclotomic_extension CyclotomicField.isCyclotomicExtension end CyclotomicField end CyclotomicField section IsDomain variable [Algebra A K] [IsFractionRing A K] section CyclotomicRing /-- If `K` is the fraction field of `A`, the `A`-algebra structure on `CyclotomicField n K`. -/ @[nolint unusedArguments] instance CyclotomicField.algebraBase : Algebra A (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra_base CyclotomicField.algebraBase /-- Ensure there are no diamonds when `A = ℤ`. -/ example : algebraInt (CyclotomicField n ℚ) = CyclotomicField.algebraBase _ _ _ := rfl instance CyclotomicField.algebra' {R : Type*} [CommRing R] [Algebra R K] : Algebra R (CyclotomicField n K) := SplittingField.algebra' (cyclotomic n K) #align cyclotomic_field.algebra' CyclotomicField.algebra' instance {R : Type*} [CommRing R] [Algebra R K] : IsScalarTower R K (CyclotomicField n K) := SplittingField.isScalarTower _ instance CyclotomicField.noZeroSMulDivisors : NoZeroSMulDivisors A (CyclotomicField n K) := by refine' NoZeroSMulDivisors.of_algebraMap_injective _ rw [IsScalarTower.algebraMap_eq A K (CyclotomicField n K)] exact (Function.Injective.comp (NoZeroSMulDivisors.algebraMap_injective K (CyclotomicField n K)) (IsFractionRing.injective A K) : _) #align cyclotomic_field.no_zero_smul_divisors CyclotomicField.noZeroSMulDivisors /-- If `A` is a domain with fraction field `K` and `n : ℕ+`, we define `CyclotomicRing n A K` as the `A`-subalgebra of `CyclotomicField n K` generated by the roots of `X ^ n - 1`. If `n` is nonzero in `A`, it has the instance `IsCyclotomicExtension {n} A (CyclotomicRing n A K)`. -/ @[nolint unusedArguments] def CyclotomicRing : Type w := adjoin A {b : CyclotomicField n K | b ^ (n : ℕ) = 1} --deriving CommRing, IsDomain, Inhabited #align cyclotomic_ring CyclotomicRing namespace CyclotomicRing --Porting note: could not be derived instance : CommRing (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : IsDomain (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance --Porting note: could not be derived instance : Inhabited (CyclotomicRing n A K) := by delta CyclotomicRing; infer_instance /-- The `A`-algebra structure on `CyclotomicRing n A K`. -/ instance algebraBase : Algebra A (CyclotomicRing n A K) := (adjoin A _).algebra #align cyclotomic_ring.algebra_base CyclotomicRing.algebraBase -- Ensure that there is no diamonds with ℤ. example {n : ℕ+} : CyclotomicRing.algebraBase n ℤ ℚ = algebraInt _ := rfl instance : NoZeroSMulDivisors A (CyclotomicRing n A K) := (adjoin A _).noZeroSMulDivisors_bot theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K) := NoZeroSMulDivisors.algebraMap_injective _ _ #align cyclotomic_ring.algebra_base_injective CyclotomicRing.algebraBase_injective instance : Algebra (CyclotomicRing n A K) (CyclotomicField n K) := (adjoin A _).toAlgebra theorem adjoin_algebra_injective : Function.Injective <| algebraMap (CyclotomicRing n A K) (CyclotomicField n K) := Subtype.val_injective #align cyclotomic_ring.adjoin_algebra_injective CyclotomicRing.adjoin_algebra_injective instance : NoZeroSMulDivisors (CyclotomicRing n A K) (CyclotomicField n K) := NoZeroSMulDivisors.of_algebraMap_injective (adjoin_algebra_injective n A K) instance : IsScalarTower A (CyclotomicRing n A K) (CyclotomicField n K) := IsScalarTower.subalgebra' _ _ _ _ instance isCyclotomicExtension [NeZero ((n : ℕ) : A)] : IsCyclotomicExtension {n} A (CyclotomicRing n A K) where exists_prim_root := @fun a han => by rw [mem_singleton_iff] at han subst a haveI := NeZero.of_noZeroSMulDivisors A K n haveI := NeZero.of_noZeroSMulDivisors A (CyclotomicField n K) n obtain ⟨μ, hμ⟩ := (CyclotomicField.isCyclotomicExtension n K).exists_prim_root (mem_singleton n) refine' ⟨⟨μ, subset_adjoin _⟩, _⟩ · apply (isRoot_of_unity_iff n.pos (CyclotomicField n K)).mpr refine' ⟨n, Nat.mem_divisors_self _ n.ne_zero, _⟩ rwa [← isRoot_cyclotomic_iff] at hμ · rwa [← IsPrimitiveRoot.coe_submonoidClass_iff, Subtype.coe_mk] adjoin_roots x := by refine' adjoin_induction' (fun y hy => _) (fun a => _) (fun y z hy hz => _) (fun y z hy hz => _) x · refine' subset_adjoin _ simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rwa [← Subalgebra.coe_eq_one, Subalgebra.coe_pow, Subtype.coe_mk] · exact Subalgebra.algebraMap_mem _ a · exact Subalgebra.add_mem _ hy hz · exact Subalgebra.mul_mem _ hy hz #align cyclotomic_ring.is_cyclotomic_extension CyclotomicRing.isCyclotomicExtension instance [IsDomain A] [NeZero ((n : ℕ) : A)] : IsFractionRing (CyclotomicRing n A K) (CyclotomicField n K) where map_units' := fun ⟨x, hx⟩ => by rw [isUnit_iff_ne_zero] apply map_ne_zero_of_mem_nonZeroDivisors apply adjoin_algebra_injective exact hx surj' x := by letI : NeZero ((n : ℕ) : K) := NeZero.nat_of_injective (IsFractionRing.injective A K) refine Algebra.adjoin_induction (((IsCyclotomicExtension.iff_singleton n K (CyclotomicField n K)).1 (CyclotomicField.isCyclotomicExtension n K)).2 x) (fun y hy => ?_) (fun k => ?_) ?_ ?_ -- Porting note: the last goal was `by simpa` that now fails. · exact ⟨⟨⟨y, subset_adjoin hy⟩, 1⟩, by simp; rfl⟩ · have : IsLocalization (nonZeroDivisors A) K := inferInstance replace := this.surj obtain ⟨⟨z, w⟩, hw⟩ := this k refine' ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, _⟩ letI : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, ← RingHom.map_mul, hw, ← IsScalarTower.algebraMap_apply] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.2 + b.1 * a.2, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, add_mul, ← mul_assoc, ha, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, hb] simp only [map_add, map_mul] · rintro y z ⟨a, ha⟩ ⟨b, hb⟩ refine' ⟨⟨a.1 * b.1, a.2 * b.2, mul_mem_nonZeroDivisors.2 ⟨a.2.2, b.2.2⟩⟩, _⟩ rw [RingHom.map_mul, mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), mul_assoc, ← mul_assoc z, hb, ← mul_comm ((algebraMap (CyclotomicRing n A K) _) ↑a.2), ← mul_assoc, ha] simp only [map_mul] exists_of_eq {x y} h := ⟨1, by rw [adjoin_algebra_injective n A K h]⟩ theorem eq_adjoin_primitive_root {μ : CyclotomicField n K} (h : IsPrimitiveRoot μ n) : CyclotomicRing n A K = adjoin A ({μ} : Set (CyclotomicField n K)) := by rw [← IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic h, IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots h] simp [CyclotomicRing] #align cyclotomic_ring.eq_adjoin_primitive_root CyclotomicRing.eq_adjoin_primitive_root end CyclotomicRing end CyclotomicRing end IsDomain section IsAlgClosed variable [IsAlgClosed K] /-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K := by refine' ⟨@fun a ha => _, Algebra.eq_top_iff.mp <| Subsingleton.elim _ _⟩ obtain ⟨r, hr⟩ := IsAlgClosed.exists_aeval_eq_zero K _ (degree_cyclotomic_pos a K a.pos).ne' refine' ⟨r, _⟩ haveI := h a ha
rwa [coe_aeval_eq_eval, ← IsRoot.def, isRoot_cyclotomic_iff] at hr
/-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K := by refine' ⟨@fun a ha => _, Algebra.eq_top_iff.mp <| Subsingleton.elim _ _⟩ obtain ⟨r, hr⟩ := IsAlgClosed.exists_aeval_eq_zero K _ (degree_cyclotomic_pos a K a.pos).ne' refine' ⟨r, _⟩ haveI := h a ha
Mathlib.NumberTheory.Cyclotomic.Basic.729_0.xReI1DeVvechFQU
/-- Algebraically closed fields are `S`-cyclotomic extensions over themselves if `NeZero ((a : ℕ) : K))` for all `a ∈ S`. -/ theorem IsAlgClosed.isCyclotomicExtension (h : ∀ a ∈ S, NeZero ((a : ℕ) : K)) : IsCyclotomicExtension S K K
Mathlib_NumberTheory_Cyclotomic_Basic
ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E h : ¬AffineIndependent 𝕜 f ⊢ ∃ I, Set.Nonempty ((convexHull 𝕜) (f '' I) ∩ (convexHull 𝕜) (f '' Iᶜ))
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by
rw [affineIndependent_iff] at h
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E h : ¬∀ (s : Finset ι) (w : ι → 𝕜), Finset.sum s w = 0 → ∑ e in s, w e • f e = 0 → ∀ e ∈ s, w e = 0 ⊢ ∃ I, Set.Nonempty ((convexHull 𝕜) (f '' I) ∩ (convexHull 𝕜) (f '' Iᶜ))
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h
push_neg at h
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E h : ∃ s w, Finset.sum s w = 0 ∧ ∑ e in s, w e • f e = 0 ∧ ∃ e ∈ s, w e ≠ 0 ⊢ ∃ I, Set.Nonempty ((convexHull 𝕜) (f '' I) ∩ (convexHull 𝕜) (f '' Iᶜ))
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h
obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
case intro.intro.intro.intro.intro.intro ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 ⊢ ∃ I, Set.Nonempty ((convexHull 𝕜) (f '' I) ∩ (convexHull 𝕜) (f '' Iᶜ))
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h
let I : Finset ι := s.filter fun i ↦ 0 ≤ w i
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
case intro.intro.intro.intro.intro.intro ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s ⊢ ∃ I, Set.Nonempty ((convexHull 𝕜) (f '' I) ∩ (convexHull 𝕜) (f '' Iᶜ))
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i
let J : Finset ι := s.filter fun i ↦ w i < 0
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
case intro.intro.intro.intro.intro.intro ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s ⊢ ∃ I, Set.Nonempty ((convexHull 𝕜) (f '' I) ∩ (convexHull 𝕜) (f '' Iᶜ))
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0
let p : E := centerMass I w f
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
case intro.intro.intro.intro.intro.intro ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f ⊢ ∃ I, Set.Nonempty ((convexHull 𝕜) (f '' I) ∩ (convexHull 𝕜) (f '' Iᶜ))
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection
have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f ⊢ ∑ j in J, w j + ∑ i in I, w i = 0
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by
simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
case intro.intro.intro.intro.intro.intro ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f hJI : ∑ j in J, w j + ∑ i in I, w i = 0 ⊢ ∃ I, Set.Nonempty ((convexHull 𝕜) (f '' I) ∩ (convexHull 𝕜) (f '' Iᶜ))
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w
have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f hJI : ∑ j in J, w j + ∑ i in I, w i = 0 ⊢ 0 < ∑ i in I, w i
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by
rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
case intro.intro ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f hJI : ∑ j in J, w j + ∑ i in I, w i = 0 pos_w_index : ι h1' : pos_w_index ∈ s h2' : 0 < w pos_w_index ⊢ 0 < ∑ i in I, w i
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩
exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f hJI : ∑ j in J, w j + ∑ i in I, w i = 0 pos_w_index : ι h1' : pos_w_index ∈ s h2' : 0 < w pos_w_index ⊢ pos_w_index ∈ I ∧ 0 < w pos_w_index
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by
simp only [mem_filter, h1', h2'.le, and_self, h2']
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
case intro.intro.intro.intro.intro.intro ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f hJI : ∑ j in J, w j + ∑ i in I, w i = 0 hI : 0 < ∑ i in I, w i ⊢ ∃ I, Set.Nonempty ((convexHull 𝕜) (f '' I) ∩ (convexHull 𝕜) (f '' Iᶜ))
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩
have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f hJI : ∑ j in J, w j + ∑ i in I, w i = 0 hI : 0 < ∑ i in I, w i ⊢ ∑ i in J, w i • f i + ∑ i in I, w i • f i = 0
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by
simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
case intro.intro.intro.intro.intro.intro ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f hJI : ∑ j in J, w j + ∑ i in I, w i = 0 hI : 0 < ∑ i in I, w i hp : centerMass J w f = p ⊢ ∃ I, Set.Nonempty ((convexHull 𝕜) (f '' I) ∩ (convexHull 𝕜) (f '' Iᶜ))
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _
refine ⟨I, p, ?_, ?_⟩
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
case intro.intro.intro.intro.intro.intro.refine_1 ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f hJI : ∑ j in J, w j + ∑ i in I, w i = 0 hI : 0 < ∑ i in I, w i hp : centerMass J w f = p ⊢ p ∈ (convexHull 𝕜) (f '' ↑I)
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _ refine ⟨I, p, ?_, ?_⟩ ·
exact centerMass_mem_convexHull _ (fun _i hi ↦ (mem_filter.mp hi).2) hI (fun _i hi ↦ Set.mem_image_of_mem _ hi)
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _ refine ⟨I, p, ?_, ?_⟩ ·
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
case intro.intro.intro.intro.intro.intro.refine_2 ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f hJI : ∑ j in J, w j + ∑ i in I, w i = 0 hI : 0 < ∑ i in I, w i hp : centerMass J w f = p ⊢ p ∈ (convexHull 𝕜) (f '' (↑I)ᶜ)
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _ refine ⟨I, p, ?_, ?_⟩ · exact centerMass_mem_convexHull _ (fun _i hi ↦ (mem_filter.mp hi).2) hI (fun _i hi ↦ Set.mem_image_of_mem _ hi)
rw [← hp]
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _ refine ⟨I, p, ?_, ?_⟩ · exact centerMass_mem_convexHull _ (fun _i hi ↦ (mem_filter.mp hi).2) hI (fun _i hi ↦ Set.mem_image_of_mem _ hi)
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
case intro.intro.intro.intro.intro.intro.refine_2 ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f hJI : ∑ j in J, w j + ∑ i in I, w i = 0 hI : 0 < ∑ i in I, w i hp : centerMass J w f = p ⊢ centerMass J w f ∈ (convexHull 𝕜) (f '' (↑I)ᶜ)
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _ refine ⟨I, p, ?_, ?_⟩ · exact centerMass_mem_convexHull _ (fun _i hi ↦ (mem_filter.mp hi).2) hI (fun _i hi ↦ Set.mem_image_of_mem _ hi) rw [← hp]
refine centerMass_mem_convexHull_of_nonpos _ (fun _ hi ↦ (mem_filter.mp hi).2.le) ?_ (fun _i hi ↦ Set.mem_image_of_mem _ fun hi' ↦ ?_)
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _ refine ⟨I, p, ?_, ?_⟩ · exact centerMass_mem_convexHull _ (fun _i hi ↦ (mem_filter.mp hi).2) hI (fun _i hi ↦ Set.mem_image_of_mem _ hi) rw [← hp]
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
case intro.intro.intro.intro.intro.intro.refine_2.refine_1 ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f hJI : ∑ j in J, w j + ∑ i in I, w i = 0 hI : 0 < ∑ i in I, w i hp : centerMass J w f = p ⊢ ∑ i in J, w i < 0
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _ refine ⟨I, p, ?_, ?_⟩ · exact centerMass_mem_convexHull _ (fun _i hi ↦ (mem_filter.mp hi).2) hI (fun _i hi ↦ Set.mem_image_of_mem _ hi) rw [← hp] refine centerMass_mem_convexHull_of_nonpos _ (fun _ hi ↦ (mem_filter.mp hi).2.le) ?_ (fun _i hi ↦ Set.mem_image_of_mem _ fun hi' ↦ ?_) ·
linarith only [hI, hJI]
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _ refine ⟨I, p, ?_, ?_⟩ · exact centerMass_mem_convexHull _ (fun _i hi ↦ (mem_filter.mp hi).2) hI (fun _i hi ↦ Set.mem_image_of_mem _ hi) rw [← hp] refine centerMass_mem_convexHull_of_nonpos _ (fun _ hi ↦ (mem_filter.mp hi).2.le) ?_ (fun _i hi ↦ Set.mem_image_of_mem _ fun hi' ↦ ?_) ·
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
case intro.intro.intro.intro.intro.intro.refine_2.refine_2 ι : Type u_1 𝕜 : Type u_2 E : Type u_3 inst✝² : LinearOrderedField 𝕜 inst✝¹ : AddCommGroup E inst✝ : Module 𝕜 E f : ι → E s : Finset ι w : ι → 𝕜 h_wsum : Finset.sum s w = 0 h_vsum : ∑ e in s, w e • f e = 0 nonzero_w_index : ι h1 : nonzero_w_index ∈ s h2 : w nonzero_w_index ≠ 0 I : Finset ι := filter (fun i => 0 ≤ w i) s J : Finset ι := filter (fun i => w i < 0) s p : E := centerMass I w f hJI : ∑ j in J, w j + ∑ i in I, w i = 0 hI : 0 < ∑ i in I, w i hp : centerMass J w f = p _i : ι hi : _i ∈ J hi' : _i ∈ ↑I ⊢ False
/- Copyright (c) 2023 Vasily Nesterov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Vasily Nesterov -/ import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith /-! # Radon's theorem on convex sets Radon's theorem states that any affine dependent set can be partitioned into two sets whose convex hulls intersect. ## Tags convex hull, radon, affine independence -/ open Finset Set open BigOperators variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E} /-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _ refine ⟨I, p, ?_, ?_⟩ · exact centerMass_mem_convexHull _ (fun _i hi ↦ (mem_filter.mp hi).2) hI (fun _i hi ↦ Set.mem_image_of_mem _ hi) rw [← hp] refine centerMass_mem_convexHull_of_nonpos _ (fun _ hi ↦ (mem_filter.mp hi).2.le) ?_ (fun _i hi ↦ Set.mem_image_of_mem _ fun hi' ↦ ?_) · linarith only [hI, hJI] ·
exact (mem_filter.mp hi').2.not_lt (mem_filter.mp hi).2
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j in J, w j + ∑ i in I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i in I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (λ _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI $ by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _ refine ⟨I, p, ?_, ?_⟩ · exact centerMass_mem_convexHull _ (fun _i hi ↦ (mem_filter.mp hi).2) hI (fun _i hi ↦ Set.mem_image_of_mem _ hi) rw [← hp] refine centerMass_mem_convexHull_of_nonpos _ (fun _ hi ↦ (mem_filter.mp hi).2.le) ?_ (fun _i hi ↦ Set.mem_image_of_mem _ fun hi' ↦ ?_) · linarith only [hI, hJI] ·
Mathlib.Analysis.Convex.Radon.25_0.TlRdL7CDP8NzLUh
/-- **Radon theorem on convex sets**: Any family `f` of affine dependent vectors contains a set `I` with the property that convex hulls of `I` and `Iᶜ` intersect. -/ theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty
Mathlib_Analysis_Convex_Radon
𝕜 : Type u_1 E : Type u_2 F : Type u_3 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E f : ℝ → E n : ℕ s : Set ℝ x₀ : ℝ ⊢ taylorWithin f (n + 1) s x₀ = taylorWithin f n s x₀ + (PolynomialModule.comp (Polynomial.X - Polynomial.C x₀)) ((PolynomialModule.single ℝ (n + 1)) (taylorCoeffWithin f (n + 1) s x₀))
/- Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ import Mathlib.Analysis.Calculus.Deriv.Pow import Mathlib.Analysis.Calculus.IteratedDeriv import Mathlib.Analysis.Calculus.MeanValue import Mathlib.Data.Polynomial.Module #align_import analysis.calculus.taylor from "leanprover-community/mathlib"@"3a69562db5a458db8322b190ec8d9a8bbd8a5b14" /-! # Taylor's theorem This file defines the Taylor polynomial of a real function `f : ℝ → E`, where `E` is a normed vector space over `ℝ` and proves Taylor's theorem, which states that if `f` is sufficiently smooth, then `f` can be approximated by the Taylor polynomial up to an explicit error term. ## Main definitions * `taylorCoeffWithin`: the Taylor coefficient using `iteratedDerivWithin` * `taylorWithin`: the Taylor polynomial using `iteratedDerivWithin` ## Main statements * `taylor_mean_remainder`: Taylor's theorem with the general form of the remainder term * `taylor_mean_remainder_lagrange`: Taylor's theorem with the Lagrange remainder * `taylor_mean_remainder_cauchy`: Taylor's theorem with the Cauchy remainder * `exists_taylor_mean_remainder_bound`: Taylor's theorem for vector valued functions with a polynomial bound on the remainder ## TODO * the Peano form of the remainder * the integral form of the remainder * Generalization to higher dimensions ## Tags Taylor polynomial, Taylor's theorem -/ open scoped BigOperators Interval Topology Nat open Set variable {𝕜 E F : Type*} variable [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The `k`th coefficient of the Taylor polynomial. -/ noncomputable def taylorCoeffWithin (f : ℝ → E) (k : ℕ) (s : Set ℝ) (x₀ : ℝ) : E := (k ! : ℝ)⁻¹ • iteratedDerivWithin k f s x₀ #align taylor_coeff_within taylorCoeffWithin /-- The Taylor polynomial with derivatives inside of a set `s`. The Taylor polynomial is given by $$∑_{k=0}^n \frac{(x - x₀)^k}{k!} f^{(k)}(x₀),$$ where $f^{(k)}(x₀)$ denotes the iterated derivative in the set `s`. -/ noncomputable def taylorWithin (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : PolynomialModule ℝ E := (Finset.range (n + 1)).sum fun k => PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ k (taylorCoeffWithin f k s x₀)) #align taylor_within taylorWithin /-- The Taylor polynomial with derivatives inside of a set `s` considered as a function `ℝ → E`-/ noncomputable def taylorWithinEval (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : E := PolynomialModule.eval x (taylorWithin f n s x₀) #align taylor_within_eval taylorWithinEval theorem taylorWithin_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : taylorWithin f (n + 1) s x₀ = taylorWithin f n s x₀ + PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ (n + 1) (taylorCoeffWithin f (n + 1) s x₀)) := by
dsimp only [taylorWithin]
theorem taylorWithin_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : taylorWithin f (n + 1) s x₀ = taylorWithin f n s x₀ + PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ (n + 1) (taylorCoeffWithin f (n + 1) s x₀)) := by
Mathlib.Analysis.Calculus.Taylor.75_0.INXnr4jrmq9RIjK
theorem taylorWithin_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : taylorWithin f (n + 1) s x₀ = taylorWithin f n s x₀ + PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ (n + 1) (taylorCoeffWithin f (n + 1) s x₀))
Mathlib_Analysis_Calculus_Taylor
𝕜 : Type u_1 E : Type u_2 F : Type u_3 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E f : ℝ → E n : ℕ s : Set ℝ x₀ : ℝ ⊢ ∑ k in Finset.range (n + 1 + 1), (PolynomialModule.comp (Polynomial.X - Polynomial.C x₀)) ((PolynomialModule.single ℝ k) (taylorCoeffWithin f k s x₀)) = ∑ k in Finset.range (n + 1), (PolynomialModule.comp (Polynomial.X - Polynomial.C x₀)) ((PolynomialModule.single ℝ k) (taylorCoeffWithin f k s x₀)) + (PolynomialModule.comp (Polynomial.X - Polynomial.C x₀)) ((PolynomialModule.single ℝ (n + 1)) (taylorCoeffWithin f (n + 1) s x₀))
/- Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ import Mathlib.Analysis.Calculus.Deriv.Pow import Mathlib.Analysis.Calculus.IteratedDeriv import Mathlib.Analysis.Calculus.MeanValue import Mathlib.Data.Polynomial.Module #align_import analysis.calculus.taylor from "leanprover-community/mathlib"@"3a69562db5a458db8322b190ec8d9a8bbd8a5b14" /-! # Taylor's theorem This file defines the Taylor polynomial of a real function `f : ℝ → E`, where `E` is a normed vector space over `ℝ` and proves Taylor's theorem, which states that if `f` is sufficiently smooth, then `f` can be approximated by the Taylor polynomial up to an explicit error term. ## Main definitions * `taylorCoeffWithin`: the Taylor coefficient using `iteratedDerivWithin` * `taylorWithin`: the Taylor polynomial using `iteratedDerivWithin` ## Main statements * `taylor_mean_remainder`: Taylor's theorem with the general form of the remainder term * `taylor_mean_remainder_lagrange`: Taylor's theorem with the Lagrange remainder * `taylor_mean_remainder_cauchy`: Taylor's theorem with the Cauchy remainder * `exists_taylor_mean_remainder_bound`: Taylor's theorem for vector valued functions with a polynomial bound on the remainder ## TODO * the Peano form of the remainder * the integral form of the remainder * Generalization to higher dimensions ## Tags Taylor polynomial, Taylor's theorem -/ open scoped BigOperators Interval Topology Nat open Set variable {𝕜 E F : Type*} variable [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The `k`th coefficient of the Taylor polynomial. -/ noncomputable def taylorCoeffWithin (f : ℝ → E) (k : ℕ) (s : Set ℝ) (x₀ : ℝ) : E := (k ! : ℝ)⁻¹ • iteratedDerivWithin k f s x₀ #align taylor_coeff_within taylorCoeffWithin /-- The Taylor polynomial with derivatives inside of a set `s`. The Taylor polynomial is given by $$∑_{k=0}^n \frac{(x - x₀)^k}{k!} f^{(k)}(x₀),$$ where $f^{(k)}(x₀)$ denotes the iterated derivative in the set `s`. -/ noncomputable def taylorWithin (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : PolynomialModule ℝ E := (Finset.range (n + 1)).sum fun k => PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ k (taylorCoeffWithin f k s x₀)) #align taylor_within taylorWithin /-- The Taylor polynomial with derivatives inside of a set `s` considered as a function `ℝ → E`-/ noncomputable def taylorWithinEval (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : E := PolynomialModule.eval x (taylorWithin f n s x₀) #align taylor_within_eval taylorWithinEval theorem taylorWithin_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : taylorWithin f (n + 1) s x₀ = taylorWithin f n s x₀ + PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ (n + 1) (taylorCoeffWithin f (n + 1) s x₀)) := by dsimp only [taylorWithin]
rw [Finset.sum_range_succ]
theorem taylorWithin_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : taylorWithin f (n + 1) s x₀ = taylorWithin f n s x₀ + PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ (n + 1) (taylorCoeffWithin f (n + 1) s x₀)) := by dsimp only [taylorWithin]
Mathlib.Analysis.Calculus.Taylor.75_0.INXnr4jrmq9RIjK
theorem taylorWithin_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : taylorWithin f (n + 1) s x₀ = taylorWithin f n s x₀ + PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ (n + 1) (taylorCoeffWithin f (n + 1) s x₀))
Mathlib_Analysis_Calculus_Taylor
𝕜 : Type u_1 E : Type u_2 F : Type u_3 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E f : ℝ → E n : ℕ s : Set ℝ x₀ x : ℝ ⊢ taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x + (((↑n + 1) * ↑n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀
/- Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ import Mathlib.Analysis.Calculus.Deriv.Pow import Mathlib.Analysis.Calculus.IteratedDeriv import Mathlib.Analysis.Calculus.MeanValue import Mathlib.Data.Polynomial.Module #align_import analysis.calculus.taylor from "leanprover-community/mathlib"@"3a69562db5a458db8322b190ec8d9a8bbd8a5b14" /-! # Taylor's theorem This file defines the Taylor polynomial of a real function `f : ℝ → E`, where `E` is a normed vector space over `ℝ` and proves Taylor's theorem, which states that if `f` is sufficiently smooth, then `f` can be approximated by the Taylor polynomial up to an explicit error term. ## Main definitions * `taylorCoeffWithin`: the Taylor coefficient using `iteratedDerivWithin` * `taylorWithin`: the Taylor polynomial using `iteratedDerivWithin` ## Main statements * `taylor_mean_remainder`: Taylor's theorem with the general form of the remainder term * `taylor_mean_remainder_lagrange`: Taylor's theorem with the Lagrange remainder * `taylor_mean_remainder_cauchy`: Taylor's theorem with the Cauchy remainder * `exists_taylor_mean_remainder_bound`: Taylor's theorem for vector valued functions with a polynomial bound on the remainder ## TODO * the Peano form of the remainder * the integral form of the remainder * Generalization to higher dimensions ## Tags Taylor polynomial, Taylor's theorem -/ open scoped BigOperators Interval Topology Nat open Set variable {𝕜 E F : Type*} variable [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The `k`th coefficient of the Taylor polynomial. -/ noncomputable def taylorCoeffWithin (f : ℝ → E) (k : ℕ) (s : Set ℝ) (x₀ : ℝ) : E := (k ! : ℝ)⁻¹ • iteratedDerivWithin k f s x₀ #align taylor_coeff_within taylorCoeffWithin /-- The Taylor polynomial with derivatives inside of a set `s`. The Taylor polynomial is given by $$∑_{k=0}^n \frac{(x - x₀)^k}{k!} f^{(k)}(x₀),$$ where $f^{(k)}(x₀)$ denotes the iterated derivative in the set `s`. -/ noncomputable def taylorWithin (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : PolynomialModule ℝ E := (Finset.range (n + 1)).sum fun k => PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ k (taylorCoeffWithin f k s x₀)) #align taylor_within taylorWithin /-- The Taylor polynomial with derivatives inside of a set `s` considered as a function `ℝ → E`-/ noncomputable def taylorWithinEval (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : E := PolynomialModule.eval x (taylorWithin f n s x₀) #align taylor_within_eval taylorWithinEval theorem taylorWithin_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : taylorWithin f (n + 1) s x₀ = taylorWithin f n s x₀ + PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ (n + 1) (taylorCoeffWithin f (n + 1) s x₀)) := by dsimp only [taylorWithin] rw [Finset.sum_range_succ] #align taylor_within_succ taylorWithin_succ @[simp] theorem taylorWithinEval_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x + (((n + 1 : ℝ) * n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀ := by
simp_rw [taylorWithinEval, taylorWithin_succ, LinearMap.map_add, PolynomialModule.comp_eval]
@[simp] theorem taylorWithinEval_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x + (((n + 1 : ℝ) * n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀ := by
Mathlib.Analysis.Calculus.Taylor.83_0.INXnr4jrmq9RIjK
@[simp] theorem taylorWithinEval_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x + (((n + 1 : ℝ) * n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀
Mathlib_Analysis_Calculus_Taylor
𝕜 : Type u_1 E : Type u_2 F : Type u_3 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E f : ℝ → E n : ℕ s : Set ℝ x₀ x : ℝ ⊢ (PolynomialModule.eval x) (taylorWithin f n s x₀) + (PolynomialModule.eval (Polynomial.eval x (Polynomial.X - Polynomial.C x₀))) ((PolynomialModule.single ℝ (n + 1)) (taylorCoeffWithin f (n + 1) s x₀)) = (PolynomialModule.eval x) (taylorWithin f n s x₀) + (((↑n + 1) * ↑n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀
/- Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ import Mathlib.Analysis.Calculus.Deriv.Pow import Mathlib.Analysis.Calculus.IteratedDeriv import Mathlib.Analysis.Calculus.MeanValue import Mathlib.Data.Polynomial.Module #align_import analysis.calculus.taylor from "leanprover-community/mathlib"@"3a69562db5a458db8322b190ec8d9a8bbd8a5b14" /-! # Taylor's theorem This file defines the Taylor polynomial of a real function `f : ℝ → E`, where `E` is a normed vector space over `ℝ` and proves Taylor's theorem, which states that if `f` is sufficiently smooth, then `f` can be approximated by the Taylor polynomial up to an explicit error term. ## Main definitions * `taylorCoeffWithin`: the Taylor coefficient using `iteratedDerivWithin` * `taylorWithin`: the Taylor polynomial using `iteratedDerivWithin` ## Main statements * `taylor_mean_remainder`: Taylor's theorem with the general form of the remainder term * `taylor_mean_remainder_lagrange`: Taylor's theorem with the Lagrange remainder * `taylor_mean_remainder_cauchy`: Taylor's theorem with the Cauchy remainder * `exists_taylor_mean_remainder_bound`: Taylor's theorem for vector valued functions with a polynomial bound on the remainder ## TODO * the Peano form of the remainder * the integral form of the remainder * Generalization to higher dimensions ## Tags Taylor polynomial, Taylor's theorem -/ open scoped BigOperators Interval Topology Nat open Set variable {𝕜 E F : Type*} variable [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The `k`th coefficient of the Taylor polynomial. -/ noncomputable def taylorCoeffWithin (f : ℝ → E) (k : ℕ) (s : Set ℝ) (x₀ : ℝ) : E := (k ! : ℝ)⁻¹ • iteratedDerivWithin k f s x₀ #align taylor_coeff_within taylorCoeffWithin /-- The Taylor polynomial with derivatives inside of a set `s`. The Taylor polynomial is given by $$∑_{k=0}^n \frac{(x - x₀)^k}{k!} f^{(k)}(x₀),$$ where $f^{(k)}(x₀)$ denotes the iterated derivative in the set `s`. -/ noncomputable def taylorWithin (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : PolynomialModule ℝ E := (Finset.range (n + 1)).sum fun k => PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ k (taylorCoeffWithin f k s x₀)) #align taylor_within taylorWithin /-- The Taylor polynomial with derivatives inside of a set `s` considered as a function `ℝ → E`-/ noncomputable def taylorWithinEval (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : E := PolynomialModule.eval x (taylorWithin f n s x₀) #align taylor_within_eval taylorWithinEval theorem taylorWithin_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : taylorWithin f (n + 1) s x₀ = taylorWithin f n s x₀ + PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ (n + 1) (taylorCoeffWithin f (n + 1) s x₀)) := by dsimp only [taylorWithin] rw [Finset.sum_range_succ] #align taylor_within_succ taylorWithin_succ @[simp] theorem taylorWithinEval_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x + (((n + 1 : ℝ) * n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀ := by simp_rw [taylorWithinEval, taylorWithin_succ, LinearMap.map_add, PolynomialModule.comp_eval]
congr
@[simp] theorem taylorWithinEval_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x + (((n + 1 : ℝ) * n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀ := by simp_rw [taylorWithinEval, taylorWithin_succ, LinearMap.map_add, PolynomialModule.comp_eval]
Mathlib.Analysis.Calculus.Taylor.83_0.INXnr4jrmq9RIjK
@[simp] theorem taylorWithinEval_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x + (((n + 1 : ℝ) * n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀
Mathlib_Analysis_Calculus_Taylor
case e_a 𝕜 : Type u_1 E : Type u_2 F : Type u_3 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E f : ℝ → E n : ℕ s : Set ℝ x₀ x : ℝ ⊢ (PolynomialModule.eval (Polynomial.eval x (Polynomial.X - Polynomial.C x₀))) ((PolynomialModule.single ℝ (n + 1)) (taylorCoeffWithin f (n + 1) s x₀)) = (((↑n + 1) * ↑n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀
/- Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ import Mathlib.Analysis.Calculus.Deriv.Pow import Mathlib.Analysis.Calculus.IteratedDeriv import Mathlib.Analysis.Calculus.MeanValue import Mathlib.Data.Polynomial.Module #align_import analysis.calculus.taylor from "leanprover-community/mathlib"@"3a69562db5a458db8322b190ec8d9a8bbd8a5b14" /-! # Taylor's theorem This file defines the Taylor polynomial of a real function `f : ℝ → E`, where `E` is a normed vector space over `ℝ` and proves Taylor's theorem, which states that if `f` is sufficiently smooth, then `f` can be approximated by the Taylor polynomial up to an explicit error term. ## Main definitions * `taylorCoeffWithin`: the Taylor coefficient using `iteratedDerivWithin` * `taylorWithin`: the Taylor polynomial using `iteratedDerivWithin` ## Main statements * `taylor_mean_remainder`: Taylor's theorem with the general form of the remainder term * `taylor_mean_remainder_lagrange`: Taylor's theorem with the Lagrange remainder * `taylor_mean_remainder_cauchy`: Taylor's theorem with the Cauchy remainder * `exists_taylor_mean_remainder_bound`: Taylor's theorem for vector valued functions with a polynomial bound on the remainder ## TODO * the Peano form of the remainder * the integral form of the remainder * Generalization to higher dimensions ## Tags Taylor polynomial, Taylor's theorem -/ open scoped BigOperators Interval Topology Nat open Set variable {𝕜 E F : Type*} variable [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The `k`th coefficient of the Taylor polynomial. -/ noncomputable def taylorCoeffWithin (f : ℝ → E) (k : ℕ) (s : Set ℝ) (x₀ : ℝ) : E := (k ! : ℝ)⁻¹ • iteratedDerivWithin k f s x₀ #align taylor_coeff_within taylorCoeffWithin /-- The Taylor polynomial with derivatives inside of a set `s`. The Taylor polynomial is given by $$∑_{k=0}^n \frac{(x - x₀)^k}{k!} f^{(k)}(x₀),$$ where $f^{(k)}(x₀)$ denotes the iterated derivative in the set `s`. -/ noncomputable def taylorWithin (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : PolynomialModule ℝ E := (Finset.range (n + 1)).sum fun k => PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ k (taylorCoeffWithin f k s x₀)) #align taylor_within taylorWithin /-- The Taylor polynomial with derivatives inside of a set `s` considered as a function `ℝ → E`-/ noncomputable def taylorWithinEval (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : E := PolynomialModule.eval x (taylorWithin f n s x₀) #align taylor_within_eval taylorWithinEval theorem taylorWithin_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : taylorWithin f (n + 1) s x₀ = taylorWithin f n s x₀ + PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ (n + 1) (taylorCoeffWithin f (n + 1) s x₀)) := by dsimp only [taylorWithin] rw [Finset.sum_range_succ] #align taylor_within_succ taylorWithin_succ @[simp] theorem taylorWithinEval_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x + (((n + 1 : ℝ) * n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀ := by simp_rw [taylorWithinEval, taylorWithin_succ, LinearMap.map_add, PolynomialModule.comp_eval] congr
simp only [Polynomial.eval_sub, Polynomial.eval_X, Polynomial.eval_C, PolynomialModule.eval_single, mul_inv_rev]
@[simp] theorem taylorWithinEval_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x + (((n + 1 : ℝ) * n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀ := by simp_rw [taylorWithinEval, taylorWithin_succ, LinearMap.map_add, PolynomialModule.comp_eval] congr
Mathlib.Analysis.Calculus.Taylor.83_0.INXnr4jrmq9RIjK
@[simp] theorem taylorWithinEval_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x + (((n + 1 : ℝ) * n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀
Mathlib_Analysis_Calculus_Taylor
case e_a 𝕜 : Type u_1 E : Type u_2 F : Type u_3 inst✝¹ : NormedAddCommGroup E inst✝ : NormedSpace ℝ E f : ℝ → E n : ℕ s : Set ℝ x₀ x : ℝ ⊢ (x - x₀) ^ (n + 1) • taylorCoeffWithin f (n + 1) s x₀ = ((↑n !)⁻¹ * (↑n + 1)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀
/- Copyright (c) 2022 Moritz Doll. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Doll -/ import Mathlib.Analysis.Calculus.Deriv.Pow import Mathlib.Analysis.Calculus.IteratedDeriv import Mathlib.Analysis.Calculus.MeanValue import Mathlib.Data.Polynomial.Module #align_import analysis.calculus.taylor from "leanprover-community/mathlib"@"3a69562db5a458db8322b190ec8d9a8bbd8a5b14" /-! # Taylor's theorem This file defines the Taylor polynomial of a real function `f : ℝ → E`, where `E` is a normed vector space over `ℝ` and proves Taylor's theorem, which states that if `f` is sufficiently smooth, then `f` can be approximated by the Taylor polynomial up to an explicit error term. ## Main definitions * `taylorCoeffWithin`: the Taylor coefficient using `iteratedDerivWithin` * `taylorWithin`: the Taylor polynomial using `iteratedDerivWithin` ## Main statements * `taylor_mean_remainder`: Taylor's theorem with the general form of the remainder term * `taylor_mean_remainder_lagrange`: Taylor's theorem with the Lagrange remainder * `taylor_mean_remainder_cauchy`: Taylor's theorem with the Cauchy remainder * `exists_taylor_mean_remainder_bound`: Taylor's theorem for vector valued functions with a polynomial bound on the remainder ## TODO * the Peano form of the remainder * the integral form of the remainder * Generalization to higher dimensions ## Tags Taylor polynomial, Taylor's theorem -/ open scoped BigOperators Interval Topology Nat open Set variable {𝕜 E F : Type*} variable [NormedAddCommGroup E] [NormedSpace ℝ E] /-- The `k`th coefficient of the Taylor polynomial. -/ noncomputable def taylorCoeffWithin (f : ℝ → E) (k : ℕ) (s : Set ℝ) (x₀ : ℝ) : E := (k ! : ℝ)⁻¹ • iteratedDerivWithin k f s x₀ #align taylor_coeff_within taylorCoeffWithin /-- The Taylor polynomial with derivatives inside of a set `s`. The Taylor polynomial is given by $$∑_{k=0}^n \frac{(x - x₀)^k}{k!} f^{(k)}(x₀),$$ where $f^{(k)}(x₀)$ denotes the iterated derivative in the set `s`. -/ noncomputable def taylorWithin (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : PolynomialModule ℝ E := (Finset.range (n + 1)).sum fun k => PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ k (taylorCoeffWithin f k s x₀)) #align taylor_within taylorWithin /-- The Taylor polynomial with derivatives inside of a set `s` considered as a function `ℝ → E`-/ noncomputable def taylorWithinEval (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : E := PolynomialModule.eval x (taylorWithin f n s x₀) #align taylor_within_eval taylorWithinEval theorem taylorWithin_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) : taylorWithin f (n + 1) s x₀ = taylorWithin f n s x₀ + PolynomialModule.comp (Polynomial.X - Polynomial.C x₀) (PolynomialModule.single ℝ (n + 1) (taylorCoeffWithin f (n + 1) s x₀)) := by dsimp only [taylorWithin] rw [Finset.sum_range_succ] #align taylor_within_succ taylorWithin_succ @[simp] theorem taylorWithinEval_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x + (((n + 1 : ℝ) * n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀ := by simp_rw [taylorWithinEval, taylorWithin_succ, LinearMap.map_add, PolynomialModule.comp_eval] congr simp only [Polynomial.eval_sub, Polynomial.eval_X, Polynomial.eval_C, PolynomialModule.eval_single, mul_inv_rev]
dsimp only [taylorCoeffWithin]
@[simp] theorem taylorWithinEval_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x + (((n + 1 : ℝ) * n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀ := by simp_rw [taylorWithinEval, taylorWithin_succ, LinearMap.map_add, PolynomialModule.comp_eval] congr simp only [Polynomial.eval_sub, Polynomial.eval_X, Polynomial.eval_C, PolynomialModule.eval_single, mul_inv_rev]
Mathlib.Analysis.Calculus.Taylor.83_0.INXnr4jrmq9RIjK
@[simp] theorem taylorWithinEval_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ x : ℝ) : taylorWithinEval f (n + 1) s x₀ x = taylorWithinEval f n s x₀ x + (((n + 1 : ℝ) * n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀
Mathlib_Analysis_Calculus_Taylor