Skip to content

Commit 6384090

Browse files
committed
refactor(NumberTheory): golf Cyclotomic.Basic
1 parent c4aa6b0 commit 6384090

1 file changed

Lines changed: 16 additions & 34 deletions

File tree

Mathlib/NumberTheory/Cyclotomic/Basic.lean

Lines changed: 16 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -549,42 +549,24 @@ theorem nonempty_algEquiv_adjoin_of_isSepClosed [IsCyclotomicExtension S K L]
549549
have := isSeparable S K L
550550
let i : L →ₐ[K] M := IsSepClosed.lift
551551
refine ⟨(show L ≃ₐ[K] i.fieldRange from AlgEquiv.ofInjectiveField i).trans
552-
(IntermediateField.equivOfEq (le_antisymm ?_ ?_))⟩
553-
· rintro x (hx : x ∈ i.range)
554-
let e := Subalgebra.equivOfEq _ _ ((IsCyclotomicExtension.iff_adjoin_eq_top S K L).1 ‹_›).2
555-
|>.trans Subalgebra.topEquiv
556-
have hrange : i.range = (i.comp (AlgHomClass.toAlgHom e)).range := by
557-
ext x
558-
simp only [AlgHom.mem_range, AlgHom.coe_comp, AlgHom.coe_coe, Function.comp_apply]
559-
constructor
560-
· rintro ⟨y, rfl⟩; exact ⟨e.symm y, by simp⟩
561-
· rintro ⟨y, rfl⟩; exact ⟨e y, rfl⟩
562-
rw [hrange, AlgHom.mem_range] at hx
563-
obtain ⟨⟨y, hy⟩, rfl⟩ := hx
564-
induction hy using Algebra.adjoin_induction with
565-
| mem x hx =>
566-
obtain ⟨n, hn, h1, h2⟩ := hx
567-
apply IntermediateField.subset_adjoin
568-
use n, hn, h1
569-
rw [← map_pow, ← map_one (i.comp (AlgHomClass.toAlgHom e))]
570-
congr 1
571-
apply_fun _ using Subtype.val_injective
572-
simpa
573-
| algebraMap x =>
574-
convert IntermediateField.algebraMap_mem _ x
575-
exact AlgHom.commutes _ x
576-
| add x y hx hy ihx ihy =>
577-
convert add_mem ihx ihy
578-
exact map_add (i.comp (AlgHomClass.toAlgHom e)) ⟨x, hx⟩ ⟨y, hy⟩
579-
| mul x y hx hy ihx ihy =>
580-
convert mul_mem ihx ihy
581-
exact map_mul (i.comp (AlgHomClass.toAlgHom e)) ⟨x, hx⟩ ⟨y, hy⟩
582-
· rw [IntermediateField.adjoin_le_iff]
583-
rintro x ⟨n, hn, h1, h2⟩
584-
have := NeZero.mk h1
552+
(IntermediateField.equivOfEq ?_)⟩
553+
rw [AlgHom.fieldRange_eq_map]
554+
have htop : IntermediateField.adjoin K {x : L | ∃ n ∈ S, n ≠ 0 ∧ x ^ n = 1} = ⊤ := by
555+
exact IntermediateField.adjoin_eq_top_of_algebra (F := K)
556+
(S := {x : L | ∃ n ∈ S, n ≠ 0 ∧ x ^ n = 1})
557+
(((IsCyclotomicExtension.iff_adjoin_eq_top S K L).1 ‹_›).2)
558+
rw [← htop, IntermediateField.adjoin_map]
559+
apply le_antisymm <;> rw [IntermediateField.adjoin_le_iff]
560+
· rintro _ ⟨y, ⟨n, hn, h1, h2⟩, rfl⟩
561+
exact IntermediateField.subset_adjoin (F := K)
562+
(S := {x : M | ∃ n ∈ S, n ≠ 0 ∧ x ^ n = 1}) ⟨n, hn, h1, by
563+
simpa using congrArg i h2⟩
564+
· rintro x ⟨n, hn, h1, h2⟩
565+
have : NeZero n := ⟨h1⟩
585566
obtain ⟨y, hy⟩ := exists_isPrimitiveRoot K L hn h1
586567
obtain ⟨m, -, rfl⟩ := (hy.map_of_injective (f := i) i.injective).eq_pow_of_pow_eq_one h2
587-
exact ⟨y ^ m, by simp⟩
568+
exact pow_mem (IntermediateField.subset_adjoin (F := K)
569+
(S := i '' {x : L | ∃ n ∈ S, n ≠ 0 ∧ x ^ n = 1}) ⟨y, ⟨n, hn, h1, hy.pow_eq_one⟩, rfl⟩) m
588570

589571
theorem isGalois [IsCyclotomicExtension S K L] : IsGalois K L := by
590572
rw [isGalois_iff]

0 commit comments

Comments
 (0)