field_theory.polynomial_galois_groupMathlib.FieldTheory.PolynomialGaloisGroup

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -186,9 +186,9 @@ theorem mapRoots_bijective [h : Fact (p.Splits (algebraMap F E))] :
     have key :=
       roots_map (IsScalarTower.toAlgHom F p.splitting_field E : p.splitting_field →+* E)
         ((splits_id_iff_splits _).mpr (is_splitting_field.splits p.splitting_field p))
-    rw [map_map, AlgHom.comp_algebraMap] at key 
+    rw [map_map, AlgHom.comp_algebraMap] at key
     have hy := Subtype.mem y
-    simp only [root_set, Finset.mem_coe, Multiset.mem_toFinset, key, Multiset.mem_map] at hy 
+    simp only [root_set, Finset.mem_coe, Multiset.mem_toFinset, key, Multiset.mem_map] at hy
     rcases hy with ⟨x, hx1, hx2⟩
     exact ⟨⟨x, (@Multiset.mem_toFinset _ (Classical.decEq _) _ _).mpr hx1⟩, Subtype.ext hx2⟩
 #align polynomial.gal.map_roots_bijective Polynomial.Gal.mapRoots_bijective
@@ -264,8 +264,8 @@ theorem galActionHom_injective [Fact (p.Splits (algebraMap F E))] :
   change
     roots_equiv_roots p E (ϕ • (roots_equiv_roots p E).symm (roots_equiv_roots p E ⟨x, hx⟩)) =
       roots_equiv_roots p E ⟨x, hx⟩ at
-    key 
-  rw [Equiv.symm_apply_apply] at key 
+    key
+  rw [Equiv.symm_apply_apply] at key
   exact subtype.ext_iff.mp (Equiv.injective (roots_equiv_roots p E) key)
 #align polynomial.gal.gal_action_hom_injective Polynomial.Gal.galActionHom_injective
 -/
@@ -321,10 +321,10 @@ theorem restrictProd_injective : Function.Injective (restrictProd p q) :=
     exact fun f g h => Eq.trans (Unique.eq_default f) (Unique.eq_default g).symm
   intro f g hfg
   classical
-  simp only [restrict_prod, restrict_dvd_def] at hfg 
-  simp only [dif_neg hpq, MonoidHom.prod_apply, Prod.mk.inj_iff] at hfg 
+  simp only [restrict_prod, restrict_dvd_def] at hfg
+  simp only [dif_neg hpq, MonoidHom.prod_apply, Prod.mk.inj_iff] at hfg
   ext x hx
-  rw [root_set_def, Polynomial.map_mul, Polynomial.roots_mul] at hx 
+  rw [root_set_def, Polynomial.map_mul, Polynomial.roots_mul] at hx
   cases' multiset.mem_add.mp (multiset.mem_to_finset.mp hx) with h h
   · haveI : Fact (p.splits (algebraMap F (p * q).SplittingField)) :=
       ⟨splits_of_splits_of_dvd _ hpq (splitting_field.splits (p * q)) (dvd_mul_right p q)⟩
@@ -387,7 +387,7 @@ theorem splits_in_splittingField_of_comp (hq : q.natDegree ≠ 0) :
           ((mul_eq_zero.mp
                 (nat_degree_comp.symm.trans (nat_degree_eq_of_degree_eq_some h))).resolve_right
             hq)
-    rw [← aeval_def, aeval_comp] at hx 
+    rw [← aeval_def, aeval_comp] at hx
     have h_normal : Normal F (r.comp q).SplittingField := splitting_field.normal (r.comp q)
     have qx_int := Normal.isIntegral h_normal (aeval x q)
     exact
@@ -407,7 +407,7 @@ theorem splits_in_splittingField_of_comp (hq : q.natDegree ≠ 0) :
         exact splits_zero _
       · exact False.ndrec _ (hq (by rw [h.2, nat_degree_C]))
     have key := mul_splits_in_splitting_field_of_mul h₁ h₂ hp₁ hp₂
-    rwa [← mul_comp] at key 
+    rwa [← mul_comp] at key
   exact
     WfDvdMonoid.induction_on_irreducible p (splits_zero _) (fun _ => splits_of_is_unit _)
       fun _ _ _ h => key2 (key1 h)
@@ -587,8 +587,8 @@ theorem galActionHom_bijective_of_prime_degree' {p : ℚ[X]} (p_irr : Irreducibl
             AlgEquiv.ext Complex.conj_conj,
           MonoidHom.map_one, MonoidHom.map_one])
   have key := card_complex_roots_eq_card_real_add_card_not_gal_inv p
-  simp_rw [Set.toFinset_card] at key 
-  rw [key, add_le_add_iff_left] at p_roots1 p_roots2 
+  simp_rw [Set.toFinset_card] at key
+  rw [key, add_le_add_iff_left] at p_roots1 p_roots2
   rw [key, add_right_inj]
   suffices ∀ m : ℕ, 2 ∣ m → 1 ≤ m → m ≤ 3 → m = 2 by exact this n hn p_roots1 p_roots2
   rintro m ⟨k, rfl⟩ h2 h3
Diff
@@ -524,7 +524,7 @@ theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
       exact ⟨(mem_root_set.mp w.2).2, mt (hc0 w).mpr (equiv.perm.mem_support.mp hw)⟩
     · rintro ⟨hz1, hz2⟩
       exact ⟨⟨z, mem_root_set.mpr ⟨hp, hz1⟩⟩, equiv.perm.mem_support.mpr (mt (hc0 _).mp hz2), rfl⟩
-  rw [← Finset.card_disjoint_union]
+  rw [← Finset.card_union_of_disjoint]
   · apply congr_arg Finset.card
     simp_rw [Finset.ext_iff, Finset.mem_union, ha, hb, hc]
     tauto
Diff
@@ -299,7 +299,7 @@ theorem restrictDvd_def [Decidable (q = 0)] (hpq : p ∣ q) :
 
 #print Polynomial.Gal.restrictDvd_surjective /-
 theorem restrictDvd_surjective (hpq : p ∣ q) (hq : q ≠ 0) : Function.Surjective (restrictDvd hpq) :=
-  by classical
+  by classical simp only [restrict_dvd_def, dif_neg hq, restrict_surjective]
 #align polynomial.gal.restrict_dvd_surjective Polynomial.Gal.restrictDvd_surjective
 -/
 
@@ -321,6 +321,32 @@ theorem restrictProd_injective : Function.Injective (restrictProd p q) :=
     exact fun f g h => Eq.trans (Unique.eq_default f) (Unique.eq_default g).symm
   intro f g hfg
   classical
+  simp only [restrict_prod, restrict_dvd_def] at hfg 
+  simp only [dif_neg hpq, MonoidHom.prod_apply, Prod.mk.inj_iff] at hfg 
+  ext x hx
+  rw [root_set_def, Polynomial.map_mul, Polynomial.roots_mul] at hx 
+  cases' multiset.mem_add.mp (multiset.mem_to_finset.mp hx) with h h
+  · haveI : Fact (p.splits (algebraMap F (p * q).SplittingField)) :=
+      ⟨splits_of_splits_of_dvd _ hpq (splitting_field.splits (p * q)) (dvd_mul_right p q)⟩
+    have key :
+      x =
+        algebraMap p.splitting_field (p * q).SplittingField
+          ((roots_equiv_roots p _).invFun
+            ⟨x, (@Multiset.mem_toFinset _ (Classical.decEq _) _ _).mpr h⟩) :=
+      subtype.ext_iff.mp (Equiv.apply_symm_apply (roots_equiv_roots p _) ⟨x, _⟩).symm
+    rw [key, ← AlgEquiv.restrictNormal_commutes, ← AlgEquiv.restrictNormal_commutes]
+    exact congr_arg _ (alg_equiv.ext_iff.mp hfg.1 _)
+  · haveI : Fact (q.splits (algebraMap F (p * q).SplittingField)) :=
+      ⟨splits_of_splits_of_dvd _ hpq (splitting_field.splits (p * q)) (dvd_mul_left q p)⟩
+    have key :
+      x =
+        algebraMap q.splitting_field (p * q).SplittingField
+          ((roots_equiv_roots q _).invFun
+            ⟨x, (@Multiset.mem_toFinset _ (Classical.decEq _) _ _).mpr h⟩) :=
+      subtype.ext_iff.mp (Equiv.apply_symm_apply (roots_equiv_roots q _) ⟨x, _⟩).symm
+    rw [key, ← AlgEquiv.restrictNormal_commutes, ← AlgEquiv.restrictNormal_commutes]
+    exact congr_arg _ (alg_equiv.ext_iff.mp hfg.2 _)
+  · rwa [Ne.def, mul_eq_zero, map_eq_zero, map_eq_zero, ← mul_eq_zero]
 #align polynomial.gal.restrict_prod_injective Polynomial.Gal.restrictProd_injective
 -/
 
@@ -515,7 +541,31 @@ theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
 theorem galActionHom_bijective_of_prime_degree {p : ℚ[X]} (p_irr : Irreducible p)
     (p_deg : p.natDegree.Prime)
     (p_roots : Fintype.card (p.rootSet ℂ) = Fintype.card (p.rootSet ℝ) + 2) :
-    Function.Bijective (galActionHom p ℂ) := by classical
+    Function.Bijective (galActionHom p ℂ) := by
+  classical
+  have h1 : Fintype.card (p.root_set ℂ) = p.nat_degree :=
+    by
+    simp_rw [root_set_def, Finset.coe_sort_coe, Fintype.card_coe]
+    rw [Multiset.toFinset_card_of_nodup, ← nat_degree_eq_card_roots]
+    · exact IsAlgClosed.splits_codomain p
+    · exact nodup_roots ((separable_map (algebraMap ℚ ℂ)).mpr p_irr.separable)
+  have h2 : Fintype.card p.gal = Fintype.card (gal_action_hom p ℂ).range :=
+    Fintype.card_congr (MonoidHom.ofInjective (gal_action_hom_injective p ℂ)).toEquiv
+  let conj := restrict p ℂ (complex.conj_ae.restrict_scalars ℚ)
+  refine'
+    ⟨gal_action_hom_injective p ℂ, fun x =>
+      (congr_arg (Membership.Mem x) (show (gal_action_hom p ℂ).range = ⊤ from _)).mpr
+        (Subgroup.mem_top x)⟩
+  apply Equiv.Perm.subgroup_eq_top_of_swap_mem
+  · rwa [h1]
+  · rw [h1]
+    convert prime_degree_dvd_card p_irr p_deg using 1
+    convert h2.symm
+  · exact ⟨conj, rfl⟩
+  · rw [← Equiv.Perm.card_support_eq_two]
+    apply Nat.add_left_cancel
+    rw [← p_roots, ← Set.toFinset_card (root_set p ℝ), ← Set.toFinset_card (root_set p ℂ)]
+    exact (card_complex_roots_eq_card_real_add_card_not_gal_inv p).symm
 #align polynomial.gal.gal_action_hom_bijective_of_prime_degree Polynomial.Gal.galActionHom_bijective_of_prime_degree
 -/
 
Diff
@@ -299,7 +299,7 @@ theorem restrictDvd_def [Decidable (q = 0)] (hpq : p ∣ q) :
 
 #print Polynomial.Gal.restrictDvd_surjective /-
 theorem restrictDvd_surjective (hpq : p ∣ q) (hq : q ≠ 0) : Function.Surjective (restrictDvd hpq) :=
-  by classical simp only [restrict_dvd_def, dif_neg hq, restrict_surjective]
+  by classical
 #align polynomial.gal.restrict_dvd_surjective Polynomial.Gal.restrictDvd_surjective
 -/
 
@@ -321,32 +321,6 @@ theorem restrictProd_injective : Function.Injective (restrictProd p q) :=
     exact fun f g h => Eq.trans (Unique.eq_default f) (Unique.eq_default g).symm
   intro f g hfg
   classical
-  simp only [restrict_prod, restrict_dvd_def] at hfg 
-  simp only [dif_neg hpq, MonoidHom.prod_apply, Prod.mk.inj_iff] at hfg 
-  ext x hx
-  rw [root_set_def, Polynomial.map_mul, Polynomial.roots_mul] at hx 
-  cases' multiset.mem_add.mp (multiset.mem_to_finset.mp hx) with h h
-  · haveI : Fact (p.splits (algebraMap F (p * q).SplittingField)) :=
-      ⟨splits_of_splits_of_dvd _ hpq (splitting_field.splits (p * q)) (dvd_mul_right p q)⟩
-    have key :
-      x =
-        algebraMap p.splitting_field (p * q).SplittingField
-          ((roots_equiv_roots p _).invFun
-            ⟨x, (@Multiset.mem_toFinset _ (Classical.decEq _) _ _).mpr h⟩) :=
-      subtype.ext_iff.mp (Equiv.apply_symm_apply (roots_equiv_roots p _) ⟨x, _⟩).symm
-    rw [key, ← AlgEquiv.restrictNormal_commutes, ← AlgEquiv.restrictNormal_commutes]
-    exact congr_arg _ (alg_equiv.ext_iff.mp hfg.1 _)
-  · haveI : Fact (q.splits (algebraMap F (p * q).SplittingField)) :=
-      ⟨splits_of_splits_of_dvd _ hpq (splitting_field.splits (p * q)) (dvd_mul_left q p)⟩
-    have key :
-      x =
-        algebraMap q.splitting_field (p * q).SplittingField
-          ((roots_equiv_roots q _).invFun
-            ⟨x, (@Multiset.mem_toFinset _ (Classical.decEq _) _ _).mpr h⟩) :=
-      subtype.ext_iff.mp (Equiv.apply_symm_apply (roots_equiv_roots q _) ⟨x, _⟩).symm
-    rw [key, ← AlgEquiv.restrictNormal_commutes, ← AlgEquiv.restrictNormal_commutes]
-    exact congr_arg _ (alg_equiv.ext_iff.mp hfg.2 _)
-  · rwa [Ne.def, mul_eq_zero, map_eq_zero, map_eq_zero, ← mul_eq_zero]
 #align polynomial.gal.restrict_prod_injective Polynomial.Gal.restrictProd_injective
 -/
 
@@ -541,31 +515,7 @@ theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
 theorem galActionHom_bijective_of_prime_degree {p : ℚ[X]} (p_irr : Irreducible p)
     (p_deg : p.natDegree.Prime)
     (p_roots : Fintype.card (p.rootSet ℂ) = Fintype.card (p.rootSet ℝ) + 2) :
-    Function.Bijective (galActionHom p ℂ) := by
-  classical
-  have h1 : Fintype.card (p.root_set ℂ) = p.nat_degree :=
-    by
-    simp_rw [root_set_def, Finset.coe_sort_coe, Fintype.card_coe]
-    rw [Multiset.toFinset_card_of_nodup, ← nat_degree_eq_card_roots]
-    · exact IsAlgClosed.splits_codomain p
-    · exact nodup_roots ((separable_map (algebraMap ℚ ℂ)).mpr p_irr.separable)
-  have h2 : Fintype.card p.gal = Fintype.card (gal_action_hom p ℂ).range :=
-    Fintype.card_congr (MonoidHom.ofInjective (gal_action_hom_injective p ℂ)).toEquiv
-  let conj := restrict p ℂ (complex.conj_ae.restrict_scalars ℚ)
-  refine'
-    ⟨gal_action_hom_injective p ℂ, fun x =>
-      (congr_arg (Membership.Mem x) (show (gal_action_hom p ℂ).range = ⊤ from _)).mpr
-        (Subgroup.mem_top x)⟩
-  apply Equiv.Perm.subgroup_eq_top_of_swap_mem
-  · rwa [h1]
-  · rw [h1]
-    convert prime_degree_dvd_card p_irr p_deg using 1
-    convert h2.symm
-  · exact ⟨conj, rfl⟩
-  · rw [← Equiv.Perm.card_support_eq_two]
-    apply Nat.add_left_cancel
-    rw [← p_roots, ← Set.toFinset_card (root_set p ℝ), ← Set.toFinset_card (root_set p ℂ)]
-    exact (card_complex_roots_eq_card_real_add_card_not_gal_inv p).symm
+    Function.Bijective (galActionHom p ℂ) := by classical
 #align polynomial.gal.gal_action_hom_bijective_of_prime_degree Polynomial.Gal.galActionHom_bijective_of_prime_degree
 -/
 
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2020 Thomas Browning, Patrick Lutz. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Thomas Browning, Patrick Lutz
 -/
-import Mathbin.Analysis.Complex.Polynomial
-import Mathbin.FieldTheory.Galois
-import Mathbin.GroupTheory.Perm.Cycle.Type
+import Analysis.Complex.Polynomial
+import FieldTheory.Galois
+import GroupTheory.Perm.Cycle.Type
 
 #align_import field_theory.polynomial_galois_group from "leanprover-community/mathlib"@"fdc286cc6967a012f41b87f76dcd2797b53152af"
 
Diff
@@ -206,7 +206,7 @@ instance galActionAux : MulAction p.Gal (rootSet p p.SplittingField)
     where
   smul ϕ := Set.MapsTo.restrict ϕ _ _ <| rootSet_mapsTo ϕ.toAlgHom
   one_smul _ := by ext; rfl
-  mul_smul _ _ _ := by ext; rfl
+  hMul_smul _ _ _ := by ext; rfl
 #align polynomial.gal.gal_action_aux Polynomial.Gal.galActionAux
 -/
 
@@ -216,7 +216,7 @@ instance galAction [Fact (p.Splits (algebraMap F E))] : MulAction p.Gal (rootSet
     where
   smul ϕ x := rootsEquivRoots p E (ϕ • (rootsEquivRoots p E).symm x)
   one_smul _ := by simp only [Equiv.apply_symm_apply, one_smul]
-  mul_smul _ _ _ := by simp only [Equiv.apply_symm_apply, Equiv.symm_apply_apply, mul_smul]
+  hMul_smul _ _ _ := by simp only [Equiv.apply_symm_apply, Equiv.symm_apply_apply, mul_smul]
 #align polynomial.gal.gal_action Polynomial.Gal.galAction
 -/
 
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2020 Thomas Browning, Patrick Lutz. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Thomas Browning, Patrick Lutz
-
-! This file was ported from Lean 3 source module field_theory.polynomial_galois_group
-! leanprover-community/mathlib commit fdc286cc6967a012f41b87f76dcd2797b53152af
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.Complex.Polynomial
 import Mathbin.FieldTheory.Galois
 import Mathbin.GroupTheory.Perm.Cycle.Type
 
+#align_import field_theory.polynomial_galois_group from "leanprover-community/mathlib"@"fdc286cc6967a012f41b87f76dcd2797b53152af"
+
 /-!
 # Galois Groups of Polynomials
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Thomas Browning, Patrick Lutz
 
 ! This file was ported from Lean 3 source module field_theory.polynomial_galois_group
-! leanprover-community/mathlib commit e3f4be1fcb5376c4948d7f095bec45350bfb9d1a
+! leanprover-community/mathlib commit fdc286cc6967a012f41b87f76dcd2797b53152af
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.GroupTheory.Perm.Cycle.Type
 /-!
 # Galois Groups of Polynomials
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 In this file, we introduce the Galois group of a polynomial `p` over a field `F`,
 defined as the automorphism group of its splitting field. We also provide
 some results about some extension `E` above `p.splitting_field`, and some specific
Diff
@@ -54,21 +54,26 @@ namespace Polynomial
 
 variable {F : Type _} [Field F] (p q : F[X]) (E : Type _) [Field E] [Algebra F E]
 
+#print Polynomial.Gal /-
 /-- The Galois group of a polynomial. -/
 def Gal :=
   p.SplittingField ≃ₐ[F] p.SplittingField
 deriving Group, Fintype
 #align polynomial.gal Polynomial.Gal
+-/
 
 namespace Gal
 
 instance : CoeFun p.Gal fun _ => p.SplittingField → p.SplittingField :=
   AlgEquiv.hasCoeToFun
 
+#print Polynomial.Gal.applyMulSemiringAction /-
 instance applyMulSemiringAction : MulSemiringAction p.Gal p.SplittingField :=
   AlgEquiv.applyMulSemiringAction
 #align polynomial.gal.apply_mul_semiring_action Polynomial.Gal.applyMulSemiringAction
+-/
 
+#print Polynomial.Gal.ext /-
 @[ext]
 theorem ext {σ τ : p.Gal} (h : ∀ x ∈ p.rootSet p.SplittingField, σ x = τ x) : σ = τ :=
   by
@@ -78,7 +83,9 @@ theorem ext {σ τ : p.Gal} (h : ∀ x ∈ p.rootSet p.SplittingField, σ x = τ
         ((set_like.ext_iff.mp _ x).mpr Algebra.mem_top)
   rwa [eq_top_iff, ← splitting_field.adjoin_root_set, Algebra.adjoin_le_iff]
 #align polynomial.gal.ext Polynomial.Gal.ext
+-/
 
+#print Polynomial.Gal.uniqueGalOfSplits /-
 /-- If `p` splits in `F` then the `p.gal` is trivial. -/
 def uniqueGalOfSplits (h : p.Splits (RingHom.id F)) : Unique p.Gal
     where
@@ -91,33 +98,46 @@ def uniqueGalOfSplits (h : p.Splits (RingHom.id F)) : Unique p.Gal
           ((set_like.ext_iff.mp ((is_splitting_field.splits_iff _ p).mp h) x).mp Algebra.mem_top)
       rw [AlgEquiv.commutes, AlgEquiv.commutes]
 #align polynomial.gal.unique_gal_of_splits Polynomial.Gal.uniqueGalOfSplits
+-/
 
 instance [h : Fact (p.Splits (RingHom.id F))] : Unique p.Gal :=
   uniqueGalOfSplits _ h.1
 
+#print Polynomial.Gal.uniqueGalZero /-
 instance uniqueGalZero : Unique (0 : F[X]).Gal :=
   uniqueGalOfSplits _ (splits_zero _)
 #align polynomial.gal.unique_gal_zero Polynomial.Gal.uniqueGalZero
+-/
 
+#print Polynomial.Gal.uniqueGalOne /-
 instance uniqueGalOne : Unique (1 : F[X]).Gal :=
   uniqueGalOfSplits _ (splits_one _)
 #align polynomial.gal.unique_gal_one Polynomial.Gal.uniqueGalOne
+-/
 
+#print Polynomial.Gal.uniqueGalC /-
 instance uniqueGalC (x : F) : Unique (C x).Gal :=
   uniqueGalOfSplits _ (splits_C _ _)
 #align polynomial.gal.unique_gal_C Polynomial.Gal.uniqueGalC
+-/
 
+#print Polynomial.Gal.uniqueGalX /-
 instance uniqueGalX : Unique (X : F[X]).Gal :=
   uniqueGalOfSplits _ (splits_X _)
 #align polynomial.gal.unique_gal_X Polynomial.Gal.uniqueGalX
+-/
 
+#print Polynomial.Gal.uniqueGalXSubC /-
 instance uniqueGalXSubC (x : F) : Unique (X - C x).Gal :=
   uniqueGalOfSplits _ (splits_X_sub_C _)
 #align polynomial.gal.unique_gal_X_sub_C Polynomial.Gal.uniqueGalXSubC
+-/
 
+#print Polynomial.Gal.uniqueGalXPow /-
 instance uniqueGalXPow (n : ℕ) : Unique (X ^ n : F[X]).Gal :=
   uniqueGalOfSplits _ (splits_X_pow _ _)
 #align polynomial.gal.unique_gal_X_pow Polynomial.Gal.uniqueGalXPow
+-/
 
 instance [h : Fact (p.Splits (algebraMap F E))] : Algebra p.SplittingField E :=
   (IsSplittingField.lift p.SplittingField p h.1).toRingHom.toAlgebra
@@ -126,6 +146,7 @@ instance [h : Fact (p.Splits (algebraMap F E))] : IsScalarTower F p.SplittingFie
   IsScalarTower.of_algebraMap_eq fun x =>
     ((IsSplittingField.lift p.SplittingField p h.1).commutes x).symm
 
+#print Polynomial.Gal.restrict /-
 -- The `algebra p.splitting_field E` instance above behaves badly when
 -- `E := p.splitting_field`, since it may result in a unification problem
 -- `is_splitting_field.lift.to_ring_hom.to_algebra =?= algebra.id`,
@@ -136,20 +157,26 @@ instance [h : Fact (p.Splits (algebraMap F E))] : IsScalarTower F p.SplittingFie
 def restrict [Fact (p.Splits (algebraMap F E))] : (E ≃ₐ[F] E) →* p.Gal :=
   AlgEquiv.restrictNormalHom p.SplittingField
 #align polynomial.gal.restrict Polynomial.Gal.restrict
+-/
 
+#print Polynomial.Gal.restrict_surjective /-
 theorem restrict_surjective [Fact (p.Splits (algebraMap F E))] [Normal F E] :
     Function.Surjective (restrict p E) :=
   AlgEquiv.restrictNormalHom_surjective E
 #align polynomial.gal.restrict_surjective Polynomial.Gal.restrict_surjective
+-/
 
 section RootsAction
 
+#print Polynomial.Gal.mapRoots /-
 /-- The function taking `roots p p.splitting_field` to `roots p E`. This is actually a bijection,
 see `polynomial.gal.map_roots_bijective`. -/
 def mapRoots [Fact (p.Splits (algebraMap F E))] : rootSet p p.SplittingField → rootSet p E :=
   Set.MapsTo.restrict (IsScalarTower.toAlgHom F p.SplittingField E) _ _ <| rootSet_mapsTo _
 #align polynomial.gal.map_roots Polynomial.Gal.mapRoots
+-/
 
+#print Polynomial.Gal.mapRoots_bijective /-
 theorem mapRoots_bijective [h : Fact (p.Splits (algebraMap F E))] :
     Function.Bijective (mapRoots p E) := by
   constructor
@@ -165,19 +192,25 @@ theorem mapRoots_bijective [h : Fact (p.Splits (algebraMap F E))] :
     rcases hy with ⟨x, hx1, hx2⟩
     exact ⟨⟨x, (@Multiset.mem_toFinset _ (Classical.decEq _) _ _).mpr hx1⟩, Subtype.ext hx2⟩
 #align polynomial.gal.map_roots_bijective Polynomial.Gal.mapRoots_bijective
+-/
 
+#print Polynomial.Gal.rootsEquivRoots /-
 /-- The bijection between `root_set p p.splitting_field` and `root_set p E`. -/
 def rootsEquivRoots [Fact (p.Splits (algebraMap F E))] : rootSet p p.SplittingField ≃ rootSet p E :=
   Equiv.ofBijective (mapRoots p E) (mapRoots_bijective p E)
 #align polynomial.gal.roots_equiv_roots Polynomial.Gal.rootsEquivRoots
+-/
 
+#print Polynomial.Gal.galActionAux /-
 instance galActionAux : MulAction p.Gal (rootSet p p.SplittingField)
     where
   smul ϕ := Set.MapsTo.restrict ϕ _ _ <| rootSet_mapsTo ϕ.toAlgHom
   one_smul _ := by ext; rfl
   mul_smul _ _ _ := by ext; rfl
 #align polynomial.gal.gal_action_aux Polynomial.Gal.galActionAux
+-/
 
+#print Polynomial.Gal.galAction /-
 /-- The action of `gal p` on the roots of `p` in `E`. -/
 instance galAction [Fact (p.Splits (algebraMap F E))] : MulAction p.Gal (rootSet p E)
     where
@@ -185,9 +218,11 @@ instance galAction [Fact (p.Splits (algebraMap F E))] : MulAction p.Gal (rootSet
   one_smul _ := by simp only [Equiv.apply_symm_apply, one_smul]
   mul_smul _ _ _ := by simp only [Equiv.apply_symm_apply, Equiv.symm_apply_apply, mul_smul]
 #align polynomial.gal.gal_action Polynomial.Gal.galAction
+-/
 
 variable {p E}
 
+#print Polynomial.Gal.restrict_smul /-
 /-- `polynomial.gal.restrict p E` is compatible with `polynomial.gal.gal_action p E`. -/
 @[simp]
 theorem restrict_smul [Fact (p.Splits (algebraMap F E))] (ϕ : E ≃ₐ[F] E) (x : rootSet p E) :
@@ -199,19 +234,25 @@ theorem restrict_smul [Fact (p.Splits (algebraMap F E))] (ϕ : E ≃ₐ[F] E) (x
   change ϕ (roots_equiv_roots p E ((roots_equiv_roots p E).symm x)) = ϕ x
   rw [Equiv.apply_symm_apply (roots_equiv_roots p E)]
 #align polynomial.gal.restrict_smul Polynomial.Gal.restrict_smul
+-/
 
 variable (p E)
 
+#print Polynomial.Gal.galActionHom /-
 /-- `polynomial.gal.gal_action` as a permutation representation -/
 def galActionHom [Fact (p.Splits (algebraMap F E))] : p.Gal →* Equiv.Perm (rootSet p E) :=
   MulAction.toPermHom _ _
 #align polynomial.gal.gal_action_hom Polynomial.Gal.galActionHom
+-/
 
+#print Polynomial.Gal.galActionHom_restrict /-
 theorem galActionHom_restrict [Fact (p.Splits (algebraMap F E))] (ϕ : E ≃ₐ[F] E) (x : rootSet p E) :
     ↑(galActionHom p E (restrict p E ϕ) x) = ϕ x :=
   restrict_smul ϕ x
 #align polynomial.gal.gal_action_hom_restrict Polynomial.Gal.galActionHom_restrict
+-/
 
+#print Polynomial.Gal.galActionHom_injective /-
 /-- `gal p` embeds as a subgroup of permutations of the roots of `p` in `E`. -/
 theorem galActionHom_injective [Fact (p.Splits (algebraMap F E))] :
     Function.Injective (galActionHom p E) :=
@@ -227,11 +268,13 @@ theorem galActionHom_injective [Fact (p.Splits (algebraMap F E))] :
   rw [Equiv.symm_apply_apply] at key 
   exact subtype.ext_iff.mp (Equiv.injective (roots_equiv_roots p E) key)
 #align polynomial.gal.gal_action_hom_injective Polynomial.Gal.galActionHom_injective
+-/
 
 end RootsAction
 
 variable {p q}
 
+#print Polynomial.Gal.restrictDvd /-
 /-- `polynomial.gal.restrict`, when both fields are splitting fields of polynomials. -/
 def restrictDvd (hpq : p ∣ q) : q.Gal →* p.Gal :=
   haveI := Classical.dec (q = 0)
@@ -240,7 +283,9 @@ def restrictDvd (hpq : p ∣ q) : q.Gal →* p.Gal :=
     @restrict F _ p _ _ _
       ⟨splits_of_splits_of_dvd (algebraMap F q.splitting_field) hq (splitting_field.splits q) hpq⟩
 #align polynomial.gal.restrict_dvd Polynomial.Gal.restrictDvd
+-/
 
+#print Polynomial.Gal.restrictDvd_def /-
 theorem restrictDvd_def [Decidable (q = 0)] (hpq : p ∣ q) :
     restrictDvd hpq =
       if hq : q = 0 then 1
@@ -250,18 +295,24 @@ theorem restrictDvd_def [Decidable (q = 0)] (hpq : p ∣ q) :
               hpq⟩ :=
   by convert rfl
 #align polynomial.gal.restrict_dvd_def Polynomial.Gal.restrictDvd_def
+-/
 
+#print Polynomial.Gal.restrictDvd_surjective /-
 theorem restrictDvd_surjective (hpq : p ∣ q) (hq : q ≠ 0) : Function.Surjective (restrictDvd hpq) :=
   by classical simp only [restrict_dvd_def, dif_neg hq, restrict_surjective]
 #align polynomial.gal.restrict_dvd_surjective Polynomial.Gal.restrictDvd_surjective
+-/
 
 variable (p q)
 
+#print Polynomial.Gal.restrictProd /-
 /-- The Galois group of a product maps into the product of the Galois groups.  -/
 def restrictProd : (p * q).Gal →* p.Gal × q.Gal :=
   MonoidHom.prod (restrictDvd (dvd_mul_right p q)) (restrictDvd (dvd_mul_left q p))
 #align polynomial.gal.restrict_prod Polynomial.Gal.restrictProd
+-/
 
+#print Polynomial.Gal.restrictProd_injective /-
 /-- `polynomial.gal.restrict_prod` is actually a subgroup embedding. -/
 theorem restrictProd_injective : Function.Injective (restrictProd p q) :=
   by
@@ -297,7 +348,9 @@ theorem restrictProd_injective : Function.Injective (restrictProd p q) :=
     exact congr_arg _ (alg_equiv.ext_iff.mp hfg.2 _)
   · rwa [Ne.def, mul_eq_zero, map_eq_zero, map_eq_zero, ← mul_eq_zero]
 #align polynomial.gal.restrict_prod_injective Polynomial.Gal.restrictProd_injective
+-/
 
+#print Polynomial.Gal.mul_splits_in_splittingField_of_mul /-
 theorem mul_splits_in_splittingField_of_mul {p₁ q₁ p₂ q₂ : F[X]} (hq₁ : q₁ ≠ 0) (hq₂ : q₂ ≠ 0)
     (h₁ : p₁.Splits (algebraMap F q₁.SplittingField))
     (h₂ : p₂.Splits (algebraMap F q₂.SplittingField)) :
@@ -315,7 +368,9 @@ theorem mul_splits_in_splittingField_of_mul {p₁ q₁ p₂ q₂ : F[X]} (hq₁
             (splitting_field.splits _) (dvd_mul_left q₂ q₁))).comp_algebraMap]
     exact splits_comp_of_splits _ _ h₂
 #align polynomial.gal.mul_splits_in_splitting_field_of_mul Polynomial.Gal.mul_splits_in_splittingField_of_mul
+-/
 
+#print Polynomial.Gal.splits_in_splittingField_of_comp /-
 /-- `p` splits in the splitting field of `p ∘ q`, for `q` non-constant. -/
 theorem splits_in_splittingField_of_comp (hq : q.natDegree ≠ 0) :
     p.Splits (algebraMap F (p.comp q).SplittingField) :=
@@ -357,29 +412,37 @@ theorem splits_in_splittingField_of_comp (hq : q.natDegree ≠ 0) :
     WfDvdMonoid.induction_on_irreducible p (splits_zero _) (fun _ => splits_of_is_unit _)
       fun _ _ _ h => key2 (key1 h)
 #align polynomial.gal.splits_in_splitting_field_of_comp Polynomial.Gal.splits_in_splittingField_of_comp
+-/
 
+#print Polynomial.Gal.restrictComp /-
 /-- `polynomial.gal.restrict` for the composition of polynomials. -/
 def restrictComp (hq : q.natDegree ≠ 0) : (p.comp q).Gal →* p.Gal :=
   let h : Fact (Splits (algebraMap F (p.comp q).SplittingField) p) :=
     ⟨splits_in_splittingField_of_comp p q hq⟩
   @restrict F _ p _ _ _ h
 #align polynomial.gal.restrict_comp Polynomial.Gal.restrictComp
+-/
 
+#print Polynomial.Gal.restrictComp_surjective /-
 theorem restrictComp_surjective (hq : q.natDegree ≠ 0) :
     Function.Surjective (restrictComp p q hq) := by simp only [restrict_comp, restrict_surjective]
 #align polynomial.gal.restrict_comp_surjective Polynomial.Gal.restrictComp_surjective
+-/
 
 variable {p q}
 
+#print Polynomial.Gal.card_of_separable /-
 /-- For a separable polynomial, its Galois group has cardinality
 equal to the dimension of its splitting field over `F`. -/
 theorem card_of_separable (hp : p.Separable) : Fintype.card p.Gal = finrank F p.SplittingField :=
   haveI : IsGalois F p.splitting_field := IsGalois.of_separable_splitting_field hp
   IsGalois.card_aut_eq_finrank F p.splitting_field
 #align polynomial.gal.card_of_separable Polynomial.Gal.card_of_separable
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:192:11: unsupported (impossible) -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:192:11: unsupported (impossible) -/
+#print Polynomial.Gal.prime_degree_dvd_card /-
 theorem prime_degree_dvd_card [CharZero F] (p_irr : Irreducible p) (p_deg : p.natDegree.Prime) :
     p.natDegree ∣ Fintype.card p.Gal :=
   by
@@ -402,15 +465,19 @@ theorem prime_degree_dvd_card [CharZero F] (p_irr : Irreducible p) (p_deg : p.na
   apply minpoly.dvd F α
   rw [aeval_def, map_root_of_splits _ (splitting_field.splits p) hp]
 #align polynomial.gal.prime_degree_dvd_card Polynomial.Gal.prime_degree_dvd_card
+-/
 
 section Rationals
 
+#print Polynomial.Gal.splits_ℚ_ℂ /-
 theorem splits_ℚ_ℂ {p : ℚ[X]} : Fact (p.Splits (algebraMap ℚ ℂ)) :=
   ⟨IsAlgClosed.splits_codomain p⟩
 #align polynomial.gal.splits_ℚ_ℂ Polynomial.Gal.splits_ℚ_ℂ
+-/
 
 attribute [local instance] splits_ℚ_ℂ
 
+#print Polynomial.Gal.card_complex_roots_eq_card_real_add_card_not_gal_inv /-
 /-- The number of complex roots equals the number of real roots plus
     the number of roots not fixed by complex conjugation (i.e. with some imaginary component). -/
 theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
@@ -467,7 +534,9 @@ theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
     tauto
   · infer_instance
 #align polynomial.gal.card_complex_roots_eq_card_real_add_card_not_gal_inv Polynomial.Gal.card_complex_roots_eq_card_real_add_card_not_gal_inv
+-/
 
+#print Polynomial.Gal.galActionHom_bijective_of_prime_degree /-
 /-- An irreducible polynomial of prime degree with two non-real roots has full Galois group. -/
 theorem galActionHom_bijective_of_prime_degree {p : ℚ[X]} (p_irr : Irreducible p)
     (p_deg : p.natDegree.Prime)
@@ -498,7 +567,9 @@ theorem galActionHom_bijective_of_prime_degree {p : ℚ[X]} (p_irr : Irreducible
     rw [← p_roots, ← Set.toFinset_card (root_set p ℝ), ← Set.toFinset_card (root_set p ℂ)]
     exact (card_complex_roots_eq_card_real_add_card_not_gal_inv p).symm
 #align polynomial.gal.gal_action_hom_bijective_of_prime_degree Polynomial.Gal.galActionHom_bijective_of_prime_degree
+-/
 
+#print Polynomial.Gal.galActionHom_bijective_of_prime_degree' /-
 /-- An irreducible polynomial of prime degree with 1-3 non-real roots has full Galois group. -/
 theorem galActionHom_bijective_of_prime_degree' {p : ℚ[X]} (p_irr : Irreducible p)
     (p_deg : p.natDegree.Prime)
@@ -528,6 +599,7 @@ theorem galActionHom_bijective_of_prime_degree' {p : ℚ[X]} (p_irr : Irreducibl
       (nat.succ_le_iff.mpr
         (lt_of_le_of_ne h2 (show 2 * 0 + 1 ≠ 2 * k from nat.two_mul_ne_two_mul_add_one.symm)))
 #align polynomial.gal.gal_action_hom_bijective_of_prime_degree' Polynomial.Gal.galActionHom_bijective_of_prime_degree'
+-/
 
 end Rationals
 
Diff
@@ -218,7 +218,7 @@ theorem galActionHom_injective [Fact (p.Splits (algebraMap F E))] :
   by
   rw [injective_iff_map_eq_one]
   intro ϕ hϕ
-  ext (x hx)
+  ext x hx
   have key := equiv.perm.ext_iff.mp hϕ (roots_equiv_roots p E ⟨x, hx⟩)
   change
     roots_equiv_roots p E (ϕ • (roots_equiv_roots p E).symm (roots_equiv_roots p E ⟨x, hx⟩)) =
@@ -272,7 +272,7 @@ theorem restrictProd_injective : Function.Injective (restrictProd p q) :=
   classical
   simp only [restrict_prod, restrict_dvd_def] at hfg 
   simp only [dif_neg hpq, MonoidHom.prod_apply, Prod.mk.inj_iff] at hfg 
-  ext (x hx)
+  ext x hx
   rw [root_set_def, Polynomial.map_mul, Polynomial.roots_mul] at hx 
   cases' multiset.mem_add.mp (multiset.mem_to_finset.mp hx) with h h
   · haveI : Fact (p.splits (algebraMap F (p * q).SplittingField)) :=
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Thomas Browning, Patrick Lutz
 
 ! This file was ported from Lean 3 source module field_theory.polynomial_galois_group
-! leanprover-community/mathlib commit 8bdf5e9b7f395d20e104dd1e309316daee8ad547
+! leanprover-community/mathlib commit e3f4be1fcb5376c4948d7f095bec45350bfb9d1a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -163,7 +163,7 @@ theorem mapRoots_bijective [h : Fact (p.Splits (algebraMap F E))] :
     have hy := Subtype.mem y
     simp only [root_set, Finset.mem_coe, Multiset.mem_toFinset, key, Multiset.mem_map] at hy 
     rcases hy with ⟨x, hx1, hx2⟩
-    classical exact ⟨⟨x, multiset.mem_to_finset.mpr hx1⟩, Subtype.ext hx2⟩
+    exact ⟨⟨x, (@Multiset.mem_toFinset _ (Classical.decEq _) _ _).mpr hx1⟩, Subtype.ext hx2⟩
 #align polynomial.gal.map_roots_bijective Polynomial.Gal.mapRoots_bijective
 
 /-- The bijection between `root_set p p.splitting_field` and `root_set p E`. -/
@@ -280,7 +280,8 @@ theorem restrictProd_injective : Function.Injective (restrictProd p q) :=
     have key :
       x =
         algebraMap p.splitting_field (p * q).SplittingField
-          ((roots_equiv_roots p _).invFun ⟨x, multiset.mem_to_finset.mpr h⟩) :=
+          ((roots_equiv_roots p _).invFun
+            ⟨x, (@Multiset.mem_toFinset _ (Classical.decEq _) _ _).mpr h⟩) :=
       subtype.ext_iff.mp (Equiv.apply_symm_apply (roots_equiv_roots p _) ⟨x, _⟩).symm
     rw [key, ← AlgEquiv.restrictNormal_commutes, ← AlgEquiv.restrictNormal_commutes]
     exact congr_arg _ (alg_equiv.ext_iff.mp hfg.1 _)
@@ -289,7 +290,8 @@ theorem restrictProd_injective : Function.Injective (restrictProd p q) :=
     have key :
       x =
         algebraMap q.splitting_field (p * q).SplittingField
-          ((roots_equiv_roots q _).invFun ⟨x, multiset.mem_to_finset.mpr h⟩) :=
+          ((roots_equiv_roots q _).invFun
+            ⟨x, (@Multiset.mem_toFinset _ (Classical.decEq _) _ _).mpr h⟩) :=
       subtype.ext_iff.mp (Equiv.apply_symm_apply (roots_equiv_roots q _) ⟨x, _⟩).symm
     rw [key, ← AlgEquiv.restrictNormal_commutes, ← AlgEquiv.restrictNormal_commutes]
     exact congr_arg _ (alg_equiv.ext_iff.mp hfg.2 _)
@@ -304,13 +306,13 @@ theorem mul_splits_in_splittingField_of_mul {p₁ q₁ p₂ q₂ : F[X]} (hq₁
   apply splits_mul
   · rw [←
       (splitting_field.lift q₁
-          (splits_of_splits_of_dvd _ (mul_ne_zero hq₁ hq₂) (splitting_field.splits _)
-            (dvd_mul_right q₁ q₂))).comp_algebraMap]
+          (splits_of_splits_of_dvd (algebraMap F (q₁ * q₂).SplittingField) (mul_ne_zero hq₁ hq₂)
+            (splitting_field.splits _) (dvd_mul_right q₁ q₂))).comp_algebraMap]
     exact splits_comp_of_splits _ _ h₁
   · rw [←
       (splitting_field.lift q₂
-          (splits_of_splits_of_dvd _ (mul_ne_zero hq₁ hq₂) (splitting_field.splits _)
-            (dvd_mul_left q₂ q₁))).comp_algebraMap]
+          (splits_of_splits_of_dvd (algebraMap F (q₁ * q₂).SplittingField) (mul_ne_zero hq₁ hq₂)
+            (splitting_field.splits _) (dvd_mul_left q₂ q₁))).comp_algebraMap]
     exact splits_comp_of_splits _ _ h₂
 #align polynomial.gal.mul_splits_in_splitting_field_of_mul Polynomial.Gal.mul_splits_in_splittingField_of_mul
 
@@ -358,7 +360,9 @@ theorem splits_in_splittingField_of_comp (hq : q.natDegree ≠ 0) :
 
 /-- `polynomial.gal.restrict` for the composition of polynomials. -/
 def restrictComp (hq : q.natDegree ≠ 0) : (p.comp q).Gal →* p.Gal :=
-  @restrict F _ p _ _ _ ⟨splits_in_splittingField_of_comp p q hq⟩
+  let h : Fact (Splits (algebraMap F (p.comp q).SplittingField) p) :=
+    ⟨splits_in_splittingField_of_comp p q hq⟩
+  @restrict F _ p _ _ _ h
 #align polynomial.gal.restrict_comp Polynomial.Gal.restrictComp
 
 theorem restrictComp_surjective (hq : q.natDegree ≠ 0) :
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Thomas Browning, Patrick Lutz
 
 ! This file was ported from Lean 3 source module field_theory.polynomial_galois_group
-! leanprover-community/mathlib commit 9fb8964792b4237dac6200193a0d533f1b3f7423
+! leanprover-community/mathlib commit 8bdf5e9b7f395d20e104dd1e309316daee8ad547
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -46,7 +46,7 @@ equals the number of real roots plus the number of roots not fixed by complex co
 
 noncomputable section
 
-open scoped Classical Polynomial
+open scoped Polynomial
 
 open FiniteDimensional
 
@@ -163,7 +163,7 @@ theorem mapRoots_bijective [h : Fact (p.Splits (algebraMap F E))] :
     have hy := Subtype.mem y
     simp only [root_set, Finset.mem_coe, Multiset.mem_toFinset, key, Multiset.mem_map] at hy 
     rcases hy with ⟨x, hx1, hx2⟩
-    exact ⟨⟨x, multiset.mem_to_finset.mpr hx1⟩, Subtype.ext hx2⟩
+    classical exact ⟨⟨x, multiset.mem_to_finset.mpr hx1⟩, Subtype.ext hx2⟩
 #align polynomial.gal.map_roots_bijective Polynomial.Gal.mapRoots_bijective
 
 /-- The bijection between `root_set p p.splitting_field` and `root_set p E`. -/
@@ -234,14 +234,25 @@ variable {p q}
 
 /-- `polynomial.gal.restrict`, when both fields are splitting fields of polynomials. -/
 def restrictDvd (hpq : p ∣ q) : q.Gal →* p.Gal :=
+  haveI := Classical.dec (q = 0)
   if hq : q = 0 then 1
   else
     @restrict F _ p _ _ _
-      ⟨splits_of_splits_of_dvd (algebraMap F q.SplittingField) hq (SplittingField.splits q) hpq⟩
+      ⟨splits_of_splits_of_dvd (algebraMap F q.splitting_field) hq (splitting_field.splits q) hpq⟩
 #align polynomial.gal.restrict_dvd Polynomial.Gal.restrictDvd
 
+theorem restrictDvd_def [Decidable (q = 0)] (hpq : p ∣ q) :
+    restrictDvd hpq =
+      if hq : q = 0 then 1
+      else
+        @restrict F _ p _ _ _
+          ⟨splits_of_splits_of_dvd (algebraMap F q.SplittingField) hq (SplittingField.splits q)
+              hpq⟩ :=
+  by convert rfl
+#align polynomial.gal.restrict_dvd_def Polynomial.Gal.restrictDvd_def
+
 theorem restrictDvd_surjective (hpq : p ∣ q) (hq : q ≠ 0) : Function.Surjective (restrictDvd hpq) :=
-  by simp only [restrict_dvd, dif_neg hq, restrict_surjective]
+  by classical simp only [restrict_dvd_def, dif_neg hq, restrict_surjective]
 #align polynomial.gal.restrict_dvd_surjective Polynomial.Gal.restrictDvd_surjective
 
 variable (p q)
@@ -258,10 +269,11 @@ theorem restrictProd_injective : Function.Injective (restrictProd p q) :=
   · have : Unique (p * q).Gal := by rw [hpq]; infer_instance
     exact fun f g h => Eq.trans (Unique.eq_default f) (Unique.eq_default g).symm
   intro f g hfg
-  dsimp only [restrict_prod, restrict_dvd] at hfg 
+  classical
+  simp only [restrict_prod, restrict_dvd_def] at hfg 
   simp only [dif_neg hpq, MonoidHom.prod_apply, Prod.mk.inj_iff] at hfg 
   ext (x hx)
-  rw [root_set, Polynomial.map_mul, Polynomial.roots_mul] at hx 
+  rw [root_set_def, Polynomial.map_mul, Polynomial.roots_mul] at hx 
   cases' multiset.mem_add.mp (multiset.mem_to_finset.mp hx) with h h
   · haveI : Fact (p.splits (algebraMap F (p * q).SplittingField)) :=
       ⟨splits_of_splits_of_dvd _ hpq (splitting_field.splits (p * q)) (dvd_mul_right p q)⟩
@@ -456,8 +468,8 @@ theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
 theorem galActionHom_bijective_of_prime_degree {p : ℚ[X]} (p_irr : Irreducible p)
     (p_deg : p.natDegree.Prime)
     (p_roots : Fintype.card (p.rootSet ℂ) = Fintype.card (p.rootSet ℝ) + 2) :
-    Function.Bijective (galActionHom p ℂ) :=
-  by
+    Function.Bijective (galActionHom p ℂ) := by
+  classical
   have h1 : Fintype.card (p.root_set ℂ) = p.nat_degree :=
     by
     simp_rw [root_set_def, Finset.coe_sort_coe, Fintype.card_coe]
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Thomas Browning, Patrick Lutz
 
 ! This file was ported from Lean 3 source module field_theory.polynomial_galois_group
-! leanprover-community/mathlib commit caa58cbf5bfb7f81ccbaca4e8b8ac4bc2b39cc1c
+! leanprover-community/mathlib commit 9fb8964792b4237dac6200193a0d533f1b3f7423
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -76,7 +76,7 @@ theorem ext {σ τ : p.Gal} (h : ∀ x ∈ p.rootSet p.SplittingField, σ x = τ
     AlgEquiv.ext fun x =>
       (AlgHom.mem_equalizer σ.to_alg_hom τ.to_alg_hom x).mp
         ((set_like.ext_iff.mp _ x).mpr Algebra.mem_top)
-  rwa [eq_top_iff, ← splitting_field.adjoin_roots, Algebra.adjoin_le_iff]
+  rwa [eq_top_iff, ← splitting_field.adjoin_root_set, Algebra.adjoin_le_iff]
 #align polynomial.gal.ext Polynomial.Gal.ext
 
 /-- If `p` splits in `F` then the `p.gal` is trivial. -/
Diff
@@ -56,7 +56,8 @@ variable {F : Type _} [Field F] (p q : F[X]) (E : Type _) [Field E] [Algebra F E
 
 /-- The Galois group of a polynomial. -/
 def Gal :=
-  p.SplittingField ≃ₐ[F] p.SplittingField deriving Group, Fintype
+  p.SplittingField ≃ₐ[F] p.SplittingField
+deriving Group, Fintype
 #align polynomial.gal Polynomial.Gal
 
 namespace Gal
@@ -158,9 +159,9 @@ theorem mapRoots_bijective [h : Fact (p.Splits (algebraMap F E))] :
     have key :=
       roots_map (IsScalarTower.toAlgHom F p.splitting_field E : p.splitting_field →+* E)
         ((splits_id_iff_splits _).mpr (is_splitting_field.splits p.splitting_field p))
-    rw [map_map, AlgHom.comp_algebraMap] at key
+    rw [map_map, AlgHom.comp_algebraMap] at key 
     have hy := Subtype.mem y
-    simp only [root_set, Finset.mem_coe, Multiset.mem_toFinset, key, Multiset.mem_map] at hy
+    simp only [root_set, Finset.mem_coe, Multiset.mem_toFinset, key, Multiset.mem_map] at hy 
     rcases hy with ⟨x, hx1, hx2⟩
     exact ⟨⟨x, multiset.mem_to_finset.mpr hx1⟩, Subtype.ext hx2⟩
 #align polynomial.gal.map_roots_bijective Polynomial.Gal.mapRoots_bijective
@@ -222,8 +223,8 @@ theorem galActionHom_injective [Fact (p.Splits (algebraMap F E))] :
   change
     roots_equiv_roots p E (ϕ • (roots_equiv_roots p E).symm (roots_equiv_roots p E ⟨x, hx⟩)) =
       roots_equiv_roots p E ⟨x, hx⟩ at
-    key
-  rw [Equiv.symm_apply_apply] at key
+    key 
+  rw [Equiv.symm_apply_apply] at key 
   exact subtype.ext_iff.mp (Equiv.injective (roots_equiv_roots p E) key)
 #align polynomial.gal.gal_action_hom_injective Polynomial.Gal.galActionHom_injective
 
@@ -257,10 +258,10 @@ theorem restrictProd_injective : Function.Injective (restrictProd p q) :=
   · have : Unique (p * q).Gal := by rw [hpq]; infer_instance
     exact fun f g h => Eq.trans (Unique.eq_default f) (Unique.eq_default g).symm
   intro f g hfg
-  dsimp only [restrict_prod, restrict_dvd] at hfg
-  simp only [dif_neg hpq, MonoidHom.prod_apply, Prod.mk.inj_iff] at hfg
+  dsimp only [restrict_prod, restrict_dvd] at hfg 
+  simp only [dif_neg hpq, MonoidHom.prod_apply, Prod.mk.inj_iff] at hfg 
   ext (x hx)
-  rw [root_set, Polynomial.map_mul, Polynomial.roots_mul] at hx
+  rw [root_set, Polynomial.map_mul, Polynomial.roots_mul] at hx 
   cases' multiset.mem_add.mp (multiset.mem_to_finset.mp hx) with h h
   · haveI : Fact (p.splits (algebraMap F (p * q).SplittingField)) :=
       ⟨splits_of_splits_of_dvd _ hpq (splitting_field.splits (p * q)) (dvd_mul_right p q)⟩
@@ -317,7 +318,7 @@ theorem splits_in_splittingField_of_comp (hq : q.natDegree ≠ 0) :
           ((mul_eq_zero.mp
                 (nat_degree_comp.symm.trans (nat_degree_eq_of_degree_eq_some h))).resolve_right
             hq)
-    rw [← aeval_def, aeval_comp] at hx
+    rw [← aeval_def, aeval_comp] at hx 
     have h_normal : Normal F (r.comp q).SplittingField := splitting_field.normal (r.comp q)
     have qx_int := Normal.isIntegral h_normal (aeval x q)
     exact
@@ -337,7 +338,7 @@ theorem splits_in_splittingField_of_comp (hq : q.natDegree ≠ 0) :
         exact splits_zero _
       · exact False.ndrec _ (hq (by rw [h.2, nat_degree_C]))
     have key := mul_splits_in_splitting_field_of_mul h₁ h₂ hp₁ hp₂
-    rwa [← mul_comp] at key
+    rwa [← mul_comp] at key 
   exact
     WfDvdMonoid.induction_on_irreducible p (splits_zero _) (fun _ => splits_of_is_unit _)
       fun _ _ _ h => key2 (key1 h)
@@ -499,8 +500,8 @@ theorem galActionHom_bijective_of_prime_degree' {p : ℚ[X]} (p_irr : Irreducibl
             AlgEquiv.ext Complex.conj_conj,
           MonoidHom.map_one, MonoidHom.map_one])
   have key := card_complex_roots_eq_card_real_add_card_not_gal_inv p
-  simp_rw [Set.toFinset_card] at key
-  rw [key, add_le_add_iff_left] at p_roots1 p_roots2
+  simp_rw [Set.toFinset_card] at key 
+  rw [key, add_le_add_iff_left] at p_roots1 p_roots2 
   rw [key, add_right_inj]
   suffices ∀ m : ℕ, 2 ∣ m → 1 ≤ m → m ≤ 3 → m = 2 by exact this n hn p_roots1 p_roots2
   rintro m ⟨k, rfl⟩ h2 h3
Diff
@@ -46,7 +46,7 @@ equals the number of real roots plus the number of roots not fixed by complex co
 
 noncomputable section
 
-open Classical Polynomial
+open scoped Classical Polynomial
 
 open FiniteDimensional
 
Diff
@@ -173,12 +173,8 @@ def rootsEquivRoots [Fact (p.Splits (algebraMap F E))] : rootSet p p.SplittingFi
 instance galActionAux : MulAction p.Gal (rootSet p p.SplittingField)
     where
   smul ϕ := Set.MapsTo.restrict ϕ _ _ <| rootSet_mapsTo ϕ.toAlgHom
-  one_smul _ := by
-    ext
-    rfl
-  mul_smul _ _ _ := by
-    ext
-    rfl
+  one_smul _ := by ext; rfl
+  mul_smul _ _ _ := by ext; rfl
 #align polynomial.gal.gal_action_aux Polynomial.Gal.galActionAux
 
 /-- The action of `gal p` on the roots of `p` in `E`. -/
@@ -258,9 +254,7 @@ def restrictProd : (p * q).Gal →* p.Gal × q.Gal :=
 theorem restrictProd_injective : Function.Injective (restrictProd p q) :=
   by
   by_cases hpq : p * q = 0
-  · have : Unique (p * q).Gal := by
-      rw [hpq]
-      infer_instance
+  · have : Unique (p * q).Gal := by rw [hpq]; infer_instance
     exact fun f g h => Eq.trans (Unique.eq_default f) (Unique.eq_default g).symm
   intro f g hfg
   dsimp only [restrict_prod, restrict_dvd] at hfg
@@ -408,9 +402,7 @@ theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
         (galActionHom p ℂ (restrict p ℂ (Complex.conjAe.restrictScalars ℚ))).support.card :=
   by
   by_cases hp : p = 0
-  · haveI : IsEmpty (p.root_set ℂ) := by
-      rw [hp, root_set_zero]
-      infer_instance
+  · haveI : IsEmpty (p.root_set ℂ) := by rw [hp, root_set_zero]; infer_instance
     simp_rw [(gal_action_hom p ℂ _).support.eq_empty_of_isEmpty, hp, root_set_zero,
       Set.toFinset_empty, Finset.card_empty]
   have inj : Function.Injective (IsScalarTower.toAlgHom ℚ ℝ ℂ) := (algebraMap ℝ ℂ).Injective
@@ -420,10 +412,8 @@ theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
   let b : Finset ℂ := _
   let c : Finset ℂ := _
   change a.card = b.card + c.card
-  have ha : ∀ z : ℂ, z ∈ a ↔ aeval z p = 0 := by
-    intro z
-    rw [Set.mem_toFinset, mem_root_set_of_ne hp]
-    infer_instance
+  have ha : ∀ z : ℂ, z ∈ a ↔ aeval z p = 0 := by intro z;
+    rw [Set.mem_toFinset, mem_root_set_of_ne hp]; infer_instance
   have hb : ∀ z : ℂ, z ∈ b ↔ aeval z p = 0 ∧ z.im = 0 :=
     by
     intro z
@@ -432,12 +422,7 @@ theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
     · rintro ⟨w, hw, rfl⟩
       exact ⟨by rw [aeval_alg_hom_apply, hw, AlgHom.map_zero], rfl⟩
     · rintro ⟨hz1, hz2⟩
-      have key : IsScalarTower.toAlgHom ℚ ℝ ℂ z.re = z :=
-        by
-        ext
-        rfl
-        rw [hz2]
-        rfl
+      have key : IsScalarTower.toAlgHom ℚ ℝ ℂ z.re = z := by ext; rfl; rw [hz2]; rfl
       exact ⟨z.re, inj (by rwa [← aeval_alg_hom_apply, key, AlgHom.map_zero]), key⟩
   have hc0 :
     ∀ w : p.root_set ℂ,
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Thomas Browning, Patrick Lutz
 
 ! This file was ported from Lean 3 source module field_theory.polynomial_galois_group
-! leanprover-community/mathlib commit 117e93f82b5f959f8193857370109935291f0cc4
+! leanprover-community/mathlib commit caa58cbf5bfb7f81ccbaca4e8b8ac4bc2b39cc1c
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -445,7 +445,7 @@ theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
     by
     intro w
     rw [Subtype.ext_iff, gal_action_hom_restrict]
-    exact Complex.eq_conj_iff_im
+    exact Complex.conj_eq_iff_im
   have hc : ∀ z : ℂ, z ∈ c ↔ aeval z p = 0 ∧ z.im ≠ 0 :=
     by
     intro z
Diff
@@ -103,19 +103,19 @@ instance uniqueGalOne : Unique (1 : F[X]).Gal :=
 #align polynomial.gal.unique_gal_one Polynomial.Gal.uniqueGalOne
 
 instance uniqueGalC (x : F) : Unique (C x).Gal :=
-  uniqueGalOfSplits _ (splits_c _ _)
+  uniqueGalOfSplits _ (splits_C _ _)
 #align polynomial.gal.unique_gal_C Polynomial.Gal.uniqueGalC
 
 instance uniqueGalX : Unique (X : F[X]).Gal :=
-  uniqueGalOfSplits _ (splits_x _)
+  uniqueGalOfSplits _ (splits_X _)
 #align polynomial.gal.unique_gal_X Polynomial.Gal.uniqueGalX
 
 instance uniqueGalXSubC (x : F) : Unique (X - C x).Gal :=
-  uniqueGalOfSplits _ (splits_x_sub_c _)
+  uniqueGalOfSplits _ (splits_X_sub_C _)
 #align polynomial.gal.unique_gal_X_sub_C Polynomial.Gal.uniqueGalXSubC
 
 instance uniqueGalXPow (n : ℕ) : Unique (X ^ n : F[X]).Gal :=
-  uniqueGalOfSplits _ (splits_x_pow _ _)
+  uniqueGalOfSplits _ (splits_X_pow _ _)
 #align polynomial.gal.unique_gal_X_pow Polynomial.Gal.uniqueGalXPow
 
 instance [h : Fact (p.Splits (algebraMap F E))] : Algebra p.SplittingField E :=
Diff
@@ -334,12 +334,12 @@ theorem splits_in_splittingField_of_comp (hq : q.natDegree ≠ 0) :
     intro p₁ p₂ hp₁ hp₂
     by_cases h₁ : p₁.comp q = 0
     · cases' comp_eq_zero_iff.mp h₁ with h h
-      · rw [h, zero_mul]
+      · rw [h, MulZeroClass.zero_mul]
         exact splits_zero _
       · exact False.ndrec _ (hq (by rw [h.2, nat_degree_C]))
     by_cases h₂ : p₂.comp q = 0
     · cases' comp_eq_zero_iff.mp h₂ with h h
-      · rw [h, mul_zero]
+      · rw [h, MulZeroClass.mul_zero]
         exact splits_zero _
       · exact False.ndrec _ (hq (by rw [h.2, nat_degree_C]))
     have key := mul_splits_in_splitting_field_of_mul h₁ h₂ hp₁ hp₂
Diff
@@ -102,19 +102,19 @@ instance uniqueGalOne : Unique (1 : F[X]).Gal :=
   uniqueGalOfSplits _ (splits_one _)
 #align polynomial.gal.unique_gal_one Polynomial.Gal.uniqueGalOne
 
-instance uniqueGalC (x : F) : Unique (c x).Gal :=
+instance uniqueGalC (x : F) : Unique (C x).Gal :=
   uniqueGalOfSplits _ (splits_c _ _)
 #align polynomial.gal.unique_gal_C Polynomial.Gal.uniqueGalC
 
-instance uniqueGalX : Unique (x : F[X]).Gal :=
+instance uniqueGalX : Unique (X : F[X]).Gal :=
   uniqueGalOfSplits _ (splits_x _)
 #align polynomial.gal.unique_gal_X Polynomial.Gal.uniqueGalX
 
-instance uniqueGalXSubC (x : F) : Unique (x - c x).Gal :=
+instance uniqueGalXSubC (x : F) : Unique (X - C x).Gal :=
   uniqueGalOfSplits _ (splits_x_sub_c _)
 #align polynomial.gal.unique_gal_X_sub_C Polynomial.Gal.uniqueGalXSubC
 
-instance uniqueGalXPow (n : ℕ) : Unique (x ^ n : F[X]).Gal :=
+instance uniqueGalXPow (n : ℕ) : Unique (X ^ n : F[X]).Gal :=
   uniqueGalOfSplits _ (splits_x_pow _ _)
 #align polynomial.gal.unique_gal_X_pow Polynomial.Gal.uniqueGalXPow
 

Changes in mathlib4

mathlib3
mathlib4
chore: superfluous parentheses part 2 (#12131)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -163,7 +163,7 @@ theorem mapRoots_bijective [h : Fact (p.Splits (algebraMap F E))] :
         ((splits_id_iff_splits _).mpr (IsSplittingField.splits p.SplittingField p))
     rw [map_map, AlgHom.comp_algebraMap] at key
     have hy := Subtype.mem y
-    simp only [rootSet, Finset.mem_coe, (Multiset.mem_toFinset), key, Multiset.mem_map] at hy
+    simp only [rootSet, Finset.mem_coe, Multiset.mem_toFinset, key, Multiset.mem_map] at hy
     rcases hy with ⟨x, hx1, hx2⟩
     exact ⟨⟨x, (@Multiset.mem_toFinset _ (Classical.decEq _) _ _).mpr hx1⟩, Subtype.ext hx2⟩
 #align polynomial.gal.map_roots_bijective Polynomial.Gal.mapRoots_bijective
chore: classify new theorem / theorem porting notes (#11432)

Classifies by adding issue number #10756 to porting notes claiming anything equivalent to:

  • "added theorem"
  • "added theorems"
  • "new theorem"
  • "new theorems"
  • "added lemma"
  • "new lemma"
  • "new lemmas"
Diff
@@ -183,7 +183,7 @@ instance galActionAux : MulAction p.Gal (rootSet p p.SplittingField) where
 instance smul [Fact (p.Splits (algebraMap F E))] : SMul p.Gal (rootSet p E) where
   smul ϕ x := rootsEquivRoots p E (ϕ • (rootsEquivRoots p E).symm x)
 
--- Porting note: new
+-- Porting note (#10756): new theorem
 theorem smul_def [Fact (p.Splits (algebraMap F E))] (ϕ : p.Gal) (x : rootSet p E) :
     ϕ • x = rootsEquivRoots p E (ϕ • (rootsEquivRoots p E).symm x) :=
   rfl
chore(FieldTheory/PolynomialGaloisGroup): move lemmas, reduce imports (#9886)

#dependencies: Mathlib.FieldTheory.PolynomialGaloisGroup: 1826->1323 Mathlib.Analysis.Complex.Polynomial: 1811->1826

This needed one small change to a moved proof because conj is not allowed as an identifier when the ComplexConjugate locale is open.

Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>

Diff
@@ -3,9 +3,7 @@ Copyright (c) 2020 Thomas Browning, Patrick Lutz. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Thomas Browning, Patrick Lutz
 -/
-import Mathlib.Analysis.Complex.Polynomial
 import Mathlib.FieldTheory.Galois
-import Mathlib.GroupTheory.Perm.Cycle.Type
 
 #align_import field_theory.polynomial_galois_group from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a"
 
@@ -14,8 +12,7 @@ import Mathlib.GroupTheory.Perm.Cycle.Type
 
 In this file, we introduce the Galois group of a polynomial `p` over a field `F`,
 defined as the automorphism group of its splitting field. We also provide
-some results about some extension `E` above `p.SplittingField`, and some specific
-results about the Galois groups of ℚ-polynomials with specific numbers of non-real roots.
+some results about some extension `E` above `p.SplittingField`.
 
 ## Main definitions
 
@@ -434,130 +431,8 @@ theorem prime_degree_dvd_card [CharZero F] (p_irr : Irreducible p) (p_deg : p.na
   rw [aeval_def, map_rootOfSplits _ (SplittingField.splits p) hp]
 #align polynomial.gal.prime_degree_dvd_card Polynomial.Gal.prime_degree_dvd_card
 
-section Rationals
-
-theorem splits_ℚ_ℂ {p : ℚ[X]} : Fact (p.Splits (algebraMap ℚ ℂ)) :=
-  ⟨IsAlgClosed.splits_codomain p⟩
-#align polynomial.gal.splits_ℚ_ℂ Polynomial.Gal.splits_ℚ_ℂ
-
-attribute [local instance] splits_ℚ_ℂ
-attribute [local ext] Complex.ext
-
-/-- The number of complex roots equals the number of real roots plus
-    the number of roots not fixed by complex conjugation (i.e. with some imaginary component). -/
-theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
-    (p.rootSet ℂ).toFinset.card =
-      (p.rootSet ℝ).toFinset.card +
-        (galActionHom p ℂ (restrict p ℂ
-        (AlgEquiv.restrictScalars ℚ Complex.conjAe))).support.card := by
-  by_cases hp : p = 0
-  · haveI : IsEmpty (p.rootSet ℂ) := by rw [hp, rootSet_zero]; infer_instance
-    simp_rw [(galActionHom p ℂ _).support.eq_empty_of_isEmpty, hp, rootSet_zero,
-      Set.toFinset_empty, Finset.card_empty]
-  have inj : Function.Injective (IsScalarTower.toAlgHom ℚ ℝ ℂ) := (algebraMap ℝ ℂ).injective
-  rw [← Finset.card_image_of_injective _ Subtype.coe_injective, ←
-    Finset.card_image_of_injective _ inj]
-  let a : Finset ℂ := ?_
-  let b : Finset ℂ := ?_
-  let c : Finset ℂ := ?_
-  -- Porting note: was
-  --   change a.card = b.card + c.card
-  suffices a.card = b.card + c.card by exact this
-  have ha : ∀ z : ℂ, z ∈ a ↔ aeval z p = 0 := by
-    intro z; rw [Set.mem_toFinset, mem_rootSet_of_ne hp]
-  have hb : ∀ z : ℂ, z ∈ b ↔ aeval z p = 0 ∧ z.im = 0 := by
-    intro z
-    simp_rw [Finset.mem_image, Set.mem_toFinset, mem_rootSet_of_ne hp]
-    constructor
-    · rintro ⟨w, hw, rfl⟩
-      exact ⟨by rw [aeval_algHom_apply, hw, AlgHom.map_zero], rfl⟩
-    · rintro ⟨hz1, hz2⟩
-      have key : IsScalarTower.toAlgHom ℚ ℝ ℂ z.re = z := by ext; rfl; rw [hz2]; rfl
-      exact ⟨z.re, inj (by rwa [← aeval_algHom_apply, key, AlgHom.map_zero]), key⟩
-  have hc0 :
-    ∀ w : p.rootSet ℂ, galActionHom p ℂ (restrict p ℂ (Complex.conjAe.restrictScalars ℚ)) w = w ↔
-        w.val.im = 0 := by
-    intro w
-    rw [Subtype.ext_iff, galActionHom_restrict]
-    exact Complex.conj_eq_iff_im
-  have hc : ∀ z : ℂ, z ∈ c ↔ aeval z p = 0 ∧ z.im ≠ 0 := by
-    intro z
-    simp_rw [Finset.mem_image]
-    constructor
-    · rintro ⟨w, hw, rfl⟩
-      exact ⟨(mem_rootSet.mp w.2).2, mt (hc0 w).mpr (Equiv.Perm.mem_support.mp hw)⟩
-    · rintro ⟨hz1, hz2⟩
-      exact ⟨⟨z, mem_rootSet.mpr ⟨hp, hz1⟩⟩, Equiv.Perm.mem_support.mpr (mt (hc0 _).mp hz2), rfl⟩
-  rw [← Finset.card_union_of_disjoint]
-  · apply congr_arg Finset.card
-    simp_rw [Finset.ext_iff, Finset.mem_union, ha, hb, hc]
-    tauto
-  · rw [Finset.disjoint_left]
-    intro z
-    rw [hb, hc]
-    tauto
-#align polynomial.gal.card_complex_roots_eq_card_real_add_card_not_gal_inv Polynomial.Gal.card_complex_roots_eq_card_real_add_card_not_gal_inv
-
-/-- An irreducible polynomial of prime degree with two non-real roots has full Galois group. -/
-theorem galActionHom_bijective_of_prime_degree {p : ℚ[X]} (p_irr : Irreducible p)
-    (p_deg : p.natDegree.Prime)
-    (p_roots : Fintype.card (p.rootSet ℂ) = Fintype.card (p.rootSet ℝ) + 2) :
-    Function.Bijective (galActionHom p ℂ) := by
-  classical
-  have h1 : Fintype.card (p.rootSet ℂ) = p.natDegree := by
-    simp_rw [rootSet_def, Finset.coe_sort_coe, Fintype.card_coe]
-    rw [Multiset.toFinset_card_of_nodup, ← natDegree_eq_card_roots]
-    · exact IsAlgClosed.splits_codomain p
-    · exact nodup_roots ((separable_map (algebraMap ℚ ℂ)).mpr p_irr.separable)
-  have h2 : Fintype.card p.Gal = Fintype.card (galActionHom p ℂ).range :=
-    Fintype.card_congr (MonoidHom.ofInjective (galActionHom_injective p ℂ)).toEquiv
-  let conj := restrict p ℂ (Complex.conjAe.restrictScalars ℚ)
-  refine'
-    ⟨galActionHom_injective p ℂ, fun x =>
-      (congr_arg (Membership.mem x) (show (galActionHom p ℂ).range = ⊤ from _)).mpr
-        (Subgroup.mem_top x)⟩
-  apply Equiv.Perm.subgroup_eq_top_of_swap_mem
-  · rwa [h1]
-  · rw [h1]
-    convert prime_degree_dvd_card p_irr p_deg using 1
-    convert h2.symm
-  · exact ⟨conj, rfl⟩
-  · rw [← Equiv.Perm.card_support_eq_two]
-    apply Nat.add_left_cancel
-    rw [← p_roots, ← Set.toFinset_card (rootSet p ℝ), ← Set.toFinset_card (rootSet p ℂ)]
-    exact (card_complex_roots_eq_card_real_add_card_not_gal_inv p).symm
-#align polynomial.gal.gal_action_hom_bijective_of_prime_degree Polynomial.Gal.galActionHom_bijective_of_prime_degree
-
-/-- An irreducible polynomial of prime degree with 1-3 non-real roots has full Galois group. -/
-theorem galActionHom_bijective_of_prime_degree' {p : ℚ[X]} (p_irr : Irreducible p)
-    (p_deg : p.natDegree.Prime)
-    (p_roots1 : Fintype.card (p.rootSet ℝ) + 1 ≤ Fintype.card (p.rootSet ℂ))
-    (p_roots2 : Fintype.card (p.rootSet ℂ) ≤ Fintype.card (p.rootSet ℝ) + 3) :
-    Function.Bijective (galActionHom p ℂ) := by
-  apply galActionHom_bijective_of_prime_degree p_irr p_deg
-  let n := (galActionHom p ℂ (restrict p ℂ (Complex.conjAe.restrictScalars ℚ))).support.card
-  have hn : 2 ∣ n :=
-    Equiv.Perm.two_dvd_card_support
-      (by
-         rw [← MonoidHom.map_pow, ← MonoidHom.map_pow,
-          show AlgEquiv.restrictScalars ℚ Complex.conjAe ^ 2 = 1 from
-            AlgEquiv.ext Complex.conj_conj,
-          MonoidHom.map_one, MonoidHom.map_one])
-  have key := card_complex_roots_eq_card_real_add_card_not_gal_inv p
-  simp_rw [Set.toFinset_card] at key
-  rw [key, add_le_add_iff_left] at p_roots1 p_roots2
-  rw [key, add_right_inj]
-  suffices ∀ m : ℕ, 2 ∣ m → 1 ≤ m → m ≤ 3 → m = 2 by exact this n hn p_roots1 p_roots2
-  rintro m ⟨k, rfl⟩ h2 h3
-  exact le_antisymm
-      (Nat.lt_succ_iff.mp
-        (lt_of_le_of_ne h3 (show 2 * k ≠ 2 * 1 + 1 from Nat.two_mul_ne_two_mul_add_one)))
-      (Nat.succ_le_iff.mpr
-        (lt_of_le_of_ne h2 (show 2 * 0 + 1 ≠ 2 * k from Nat.two_mul_ne_two_mul_add_one.symm)))
-#align polynomial.gal.gal_action_hom_bijective_of_prime_degree' Polynomial.Gal.galActionHom_bijective_of_prime_degree'
-
-end Rationals
-
 end Gal
 
 end Polynomial
+
+assert_not_exists Real
feat: (s ∩ t).card = s.card + t.card - (s ∪ t).card (#10224)

once coerced to an AddGroupWithOne. Also unify Finset.card_disjoint_union and Finset.card_union_eq

From LeanAPAP

Diff
@@ -488,7 +488,7 @@ theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
       exact ⟨(mem_rootSet.mp w.2).2, mt (hc0 w).mpr (Equiv.Perm.mem_support.mp hw)⟩
     · rintro ⟨hz1, hz2⟩
       exact ⟨⟨z, mem_rootSet.mpr ⟨hp, hz1⟩⟩, Equiv.Perm.mem_support.mpr (mt (hc0 _).mp hz2), rfl⟩
-  rw [← Finset.card_disjoint_union]
+  rw [← Finset.card_union_of_disjoint]
   · apply congr_arg Finset.card
     simp_rw [Finset.ext_iff, Finset.mem_union, ha, hb, hc]
     tauto
feat: generalize FiniteDimensional.finrank_mul_finrank (#9046)

Generalize the conditions of the tower law FiniteDimensional.finrank_mul_finrank' in FieldTheory/Tower from [CommRing F] [Algebra F K] to [Ring F] [Module F K], and remove the [Module.Finite F K] and [Module.Finite K A] conditions.

The generalized version applies to situations when we have a tower C/B/A where the A-module structure on C is induced from the B-module structure via a RingHom from A to B, and the A-module structure on B is induced by the same RingHom. In particular, it applies when the A-module structure on B and the B-module structure on C come from two RingHoms, and the A-module structure on C comes from the composition of them, regardless of whether A and B are commutative or not.

As prerequisites, I also generalized lemmas originally introduced by @kckennylau in [mathlib3#3355](https://github.com/leanprover-community/mathlib/pull/3355/files) to prove the tower law. They were split into three PRs:

  • LinearAlgebra/Span #9380: add span_eq_closure and closure_induction which say that Submodule.span R s is generated by R • s as an AddSubmonoid. I feel that the existing span_induction should be replaced by closure_induction as the latter is stronger, and allow us to remove the commutativity condition in span_smul_of_span_eq_top in Algebra/Tower.

  • Algebra/Tower #9382: switching from CommSemiring/Algebra to Semiring/Module here requires proving the curious lemma IsScalarTower.isLinearMap which states that for a tower of modules A/S/R, any S-linear map from S to A is also R-linear. If the map is injective, we can deduce that S/S/R also form a tower. (By ringHomEquivModuleIsScalarTower in #9381, there is therefore a canonical RingHom from R to S.)

  • Lemmas for free modules over rings including finrank_mul_finrank' are moved from FieldTheory/Tower to LinearAlgebra/Dimension/Free

Zulip

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -422,6 +422,7 @@ theorem prime_degree_dvd_card [CharZero F] (p_irr : Irreducible p) (p_deg : p.na
   have hα : IsIntegral F α := .of_finite F α
   use FiniteDimensional.finrank F⟮α⟯ p.SplittingField
   suffices (minpoly F α).natDegree = p.natDegree by
+    letI _ : AddCommGroup F⟮α⟯ := Ring.toAddCommGroup
     rw [← FiniteDimensional.finrank_mul_finrank F F⟮α⟯ p.SplittingField,
       IntermediateField.adjoin.finrank hα, this]
   suffices minpoly F α ∣ p by
feat(FieldTheory/PolynomialGaloisGroup): The Galois group of an irreducible polynomial acts transitively on the roots (#9121)

This PR adds a lemma stating that the Galois group of an irreducible polynomial acts transitively on the roots.

Diff
@@ -198,6 +198,14 @@ instance galAction [Fact (p.Splits (algebraMap F E))] : MulAction p.Gal (rootSet
     simp only [smul_def, Equiv.apply_symm_apply, Equiv.symm_apply_apply, mul_smul]
 #align polynomial.gal.gal_action Polynomial.Gal.galAction
 
+lemma galAction_isPretransitive [Fact (p.Splits (algebraMap F E))] (hp : Irreducible p) :
+    MulAction.IsPretransitive p.Gal (p.rootSet E) := by
+  refine' ⟨fun x y ↦ _⟩
+  have hx := minpoly.eq_of_irreducible hp (mem_rootSet.mp ((rootsEquivRoots p E).symm x).2).2
+  have hy := minpoly.eq_of_irreducible hp (mem_rootSet.mp ((rootsEquivRoots p E).symm y).2).2
+  obtain ⟨g, hg⟩ := (Normal.minpoly_eq_iff_mem_orbit p.SplittingField).mp (hy.symm.trans hx)
+  exact ⟨g, (rootsEquivRoots p E).apply_eq_iff_eq_symm_apply.mpr (Subtype.ext hg)⟩
+
 variable {p E}
 
 /-- `Polynomial.Gal.restrict p E` is compatible with `Polynomial.Gal.galAction p E`. -/
chore: make Complex.ext only a local ext lemma (#9010)

In accordance with this Zulip thread, this remove Complex.ext from the global ext attribute list and only enables it locally in certain files.

Diff
@@ -432,6 +432,7 @@ theorem splits_ℚ_ℂ {p : ℚ[X]} : Fact (p.Splits (algebraMap ℚ ℂ)) :=
 #align polynomial.gal.splits_ℚ_ℂ Polynomial.Gal.splits_ℚ_ℂ
 
 attribute [local instance] splits_ℚ_ℂ
+attribute [local ext] Complex.ext
 
 /-- The number of complex roots equals the number of real roots plus
     the number of roots not fixed by complex conjugation (i.e. with some imaginary component). -/
chore(IntegralClosure): noncommutative generalizations and golfs (#8406)

Zulip

Initially I just wanted to add more dot notations for IsIntegral and IsAlgebraic (done in #8437); then I noticed near-duplicates Algebra.isIntegral_of_finite [Field R] [Ring A] and RingHom.IsIntegral.of_finite [CommRing R] [CommRing A] so I went on to generalize the latter to cover the former, and generalized everything in the IntegralClosure file to the noncommutative case whenever possible.

In the process I noticed more golfs, which result in this PR. Most notably, isIntegral_of_mem_of_FG is now proven using Cayley-Hamilton and doesn't depend on the Noetherian case isIntegral_of_noetherian; the latter is now proven using the former. In total the golfs makes mathlib 227 lines leaner (+487 -714).

The main changes are in the single file RingTheory/IntegralClosure:

  • Change the definition of Algebra.IsIntegral which makes it unfold to IsIntegral rather than RingHom.IsIntegralElem because the former has much more APIs.

  • Fix lemma names involving is_integral which are actually about IsIntegralElem: RingHom.is_integral_mapRingHom.isIntegralElem_map RingHom.is_integral_of_mem_closureRingHom.IsIntegralElem.of_mem_closure RingHom.is_integral_zero/oneRingHom.isIntegralElem_zero/one RingHom.is_integral_add/neg/sub/mul/of_mul_unitRingHom.IsIntegralElem.add/neg/sub/mul/of_mul_unit

  • Add a lemma Algebra.IsIntegral.of_injective.

  • Move isIntegral_of_(submodule_)noetherian down and golf them.

  • Remove (Algebra.)isIntegral_of_finite that work only over fields, in favor of the more general (Algebra.)isIntegral.of_finite.

  • Merge duplicate lemmas isIntegral_of_isScalarTower and isIntegral_tower_top_of_isIntegral into IsIntegral.tower_top.

  • Golf IsIntegral.of_mem_of_fg by first proving IsIntegral.of_finite using Cayley-Hamilton.

  • Add a docstring mentioning the Kurosh problem at Algebra.IsIntegral.finite. The negative solution to the problem means the theorem doesn't generalize to noncommutative algebras.

  • Golf IsIntegral.tmul and isField_of_isIntegral_of_isField(').

  • Combine isIntegral_trans_aux into isIntegral_trans and golf.

  • Add Algebra namespace to isIntegral_sup.

  • rename lemmas for dot notation: RingHom.isIntegral_transRingHom.IsIntegral.trans RingHom.isIntegral_quotient/tower_bot/top_of_isIntegralRingHom.IsIntegral.quotient/tower_bot/top isIntegral_of_mem_closure'IsIntegral.of_mem_closure' (and the '' version) isIntegral_of_surjectiveAlgebra.isIntegral_of_surjective

The next changed file is RingTheory/Algebraic:

  • Rename: of_larger_basetower_top (for consistency with IsIntegral) Algebra.isAlgebraic_of_finiteAlgebra.IsAlgebraic.of_finite Algebra.isAlgebraic_transAlgebra.IsAlgebraic.trans

  • Add new lemmasAlgebra.IsIntegral.isAlgebraic, isAlgebraic_algHom_iff, and Algebra.IsAlgebraic.of_injective to streamline some proofs.

The generalization from CommRing to Ring requires an additional lemma scaleRoots_eval₂_mul_of_commute in Polynomial/ScaleRoots.

A lemma Algebra.lmul_injective is added to Algebra/Bilinear (in order to golf the proof of IsIntegral.of_mem_of_fg).

In all other files, I merely fix the changed names, or use newly available dot notations.

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

Diff
@@ -411,7 +411,7 @@ theorem prime_degree_dvd_card [CharZero F] (p_irr : Irreducible p) (p_deg : p.na
     Nat.Prime.ne_zero p_deg (natDegree_eq_zero_iff_degree_le_zero.mpr (le_of_eq h))
   let α : p.SplittingField :=
     rootOfSplits (algebraMap F p.SplittingField) (SplittingField.splits p) hp
-  have hα : IsIntegral F α := Algebra.isIntegral_of_finite _ _ α
+  have hα : IsIntegral F α := .of_finite F α
   use FiniteDimensional.finrank F⟮α⟯ p.SplittingField
   suffices (minpoly F α).natDegree = p.natDegree by
     rw [← FiniteDimensional.finrank_mul_finrank F F⟮α⟯ p.SplittingField,
chore: Scope the adjoin element notation (#7938)
Diff
@@ -395,6 +395,8 @@ theorem restrictComp_surjective (hq : q.natDegree ≠ 0) :
 
 variable {p q}
 
+open scoped IntermediateField
+
 /-- For a separable polynomial, its Galois group has cardinality
 equal to the dimension of its splitting field over `F`. -/
 theorem card_of_separable (hp : p.Separable) : Fintype.card p.Gal = finrank F p.SplittingField :=
chore: removing unneeded maxHeartbeats (#7761)

Due to recent changes in core we can reduce or remove many set_option maxHeartbeats statements.

I have tried to be careful to not leave anything too close to the line, so don't be surprised if some of these can still be reduced further.

This reduces us from 96 maxHeartbeats statements to 44. (There are 10 false positives in meta or testing code.)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -330,7 +330,6 @@ theorem mul_splits_in_splittingField_of_mul {p₁ q₁ p₂ q₂ : F[X]} (hq₁
     exact splits_comp_of_splits _ _ h₂
 #align polynomial.gal.mul_splits_in_splitting_field_of_mul Polynomial.Gal.mul_splits_in_splittingField_of_mul
 
-set_option maxHeartbeats 300000 in
 /-- `p` splits in the splitting field of `p ∘ q`, for `q` non-constant. -/
 theorem splits_in_splittingField_of_comp (hq : q.natDegree ≠ 0) :
     p.Splits (algebraMap F (p.comp q).SplittingField) := by
feat: roots in an algebra (#6740)

Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>

Diff
@@ -289,7 +289,7 @@ theorem restrictProd_injective : Function.Injective (restrictProd p q) := by
   simp only [restrictProd, restrictDvd_def] at hfg
   simp only [dif_neg hpq, MonoidHom.prod_apply, Prod.mk.inj_iff] at hfg
   ext (x hx)
-  rw [rootSet_def, Polynomial.map_mul, Polynomial.roots_mul] at hx
+  rw [rootSet_def, aroots_mul hpq] at hx
   cases' Multiset.mem_add.mp (Multiset.mem_toFinset.mp hx) with h h
   · haveI : Fact (p.Splits (algebraMap F (p * q).SplittingField)) :=
       ⟨splits_of_splits_of_dvd _ hpq (SplittingField.splits (p * q)) (dvd_mul_right p q)⟩
@@ -311,7 +311,6 @@ theorem restrictProd_injective : Function.Injective (restrictProd p q) := by
       Subtype.ext_iff.mp (Equiv.apply_symm_apply (rootsEquivRoots q _) ⟨x, _⟩).symm
     rw [key, ← AlgEquiv.restrictNormal_commutes, ← AlgEquiv.restrictNormal_commutes]
     exact congr_arg _ (AlgEquiv.ext_iff.mp hfg.2 _)
-  · rwa [Ne.def, mul_eq_zero, map_eq_zero, map_eq_zero, ← mul_eq_zero]
 #align polynomial.gal.restrict_prod_injective Polynomial.Gal.restrictProd_injective
 
 theorem mul_splits_in_splittingField_of_mul {p₁ q₁ p₂ q₂ : F[X]} (hq₁ : q₁ ≠ 0) (hq₂ : q₂ ≠ 0)
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -356,12 +356,12 @@ theorem splits_in_splittingField_of_comp (hq : q.natDegree ≠ 0) :
     intro p₁ p₂ hp₁ hp₂
     by_cases h₁ : p₁.comp q = 0
     · cases' comp_eq_zero_iff.mp h₁ with h h
-      · rw [h, MulZeroClass.zero_mul]
+      · rw [h, zero_mul]
         exact splits_zero _
       · exact False.elim (hq (by rw [h.2, natDegree_C]))
     by_cases h₂ : p₂.comp q = 0
     · cases' comp_eq_zero_iff.mp h₂ with h h
-      · rw [h, MulZeroClass.mul_zero]
+      · rw [h, mul_zero]
         exact splits_zero _
       · exact False.elim (hq (by rw [h.2, natDegree_C]))
     have key := mul_splits_in_splittingField_of_mul h₁ h₂ hp₁ hp₂
chore: remove unused simps (#6632)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -457,7 +457,7 @@ theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
     intro z; rw [Set.mem_toFinset, mem_rootSet_of_ne hp]
   have hb : ∀ z : ℂ, z ∈ b ↔ aeval z p = 0 ∧ z.im = 0 := by
     intro z
-    simp_rw [Finset.mem_image, exists_prop, Set.mem_toFinset, mem_rootSet_of_ne hp]
+    simp_rw [Finset.mem_image, Set.mem_toFinset, mem_rootSet_of_ne hp]
     constructor
     · rintro ⟨w, hw, rfl⟩
       exact ⟨by rw [aeval_algHom_apply, hw, AlgHom.map_zero], rfl⟩
@@ -472,7 +472,7 @@ theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) :
     exact Complex.conj_eq_iff_im
   have hc : ∀ z : ℂ, z ∈ c ↔ aeval z p = 0 ∧ z.im ≠ 0 := by
     intro z
-    simp_rw [Finset.mem_image, exists_prop]
+    simp_rw [Finset.mem_image]
     constructor
     · rintro ⟨w, hw, rfl⟩
       exact ⟨(mem_rootSet.mp w.2).2, mt (hc0 w).mpr (Equiv.Perm.mem_support.mp hw)⟩
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -49,7 +49,7 @@ open FiniteDimensional
 
 namespace Polynomial
 
-variable {F : Type _} [Field F] (p q : F[X]) (E : Type _) [Field E] [Algebra F E]
+variable {F : Type*} [Field F] (p q : F[X]) (E : Type*) [Field E] [Algebra F E]
 
 /-- The Galois group of a polynomial. -/
 def Gal :=
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2020 Thomas Browning, Patrick Lutz. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Thomas Browning, Patrick Lutz
-
-! This file was ported from Lean 3 source module field_theory.polynomial_galois_group
-! leanprover-community/mathlib commit e3f4be1fcb5376c4948d7f095bec45350bfb9d1a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.Complex.Polynomial
 import Mathlib.FieldTheory.Galois
 import Mathlib.GroupTheory.Perm.Cycle.Type
 
+#align_import field_theory.polynomial_galois_group from "leanprover-community/mathlib"@"e3f4be1fcb5376c4948d7f095bec45350bfb9d1a"
+
 /-!
 # Galois Groups of Polynomials
 
chore: cleanup whitespace (#5988)

Grepping for [^ .:{-] [^ :] and reviewing the results. Once I started I couldn't stop. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -376,7 +376,7 @@ theorem splits_in_splittingField_of_comp (hq : q.natDegree ≠ 0) :
   --    fun _ _ _ h => key2 (key1 h)
   induction p using WfDvdMonoid.induction_on_irreducible with
   | h0 => exact splits_zero _
-  | hu u hu =>  exact splits_of_isUnit (algebraMap F (SplittingField (comp u q))) hu
+  | hu u hu => exact splits_of_isUnit (algebraMap F (SplittingField (comp u q))) hu
   -- Porting note: using `exact` instead of `apply` times out
   | hi p₁ p₂ _ hp₂ hp₁ => apply key2 (key1 hp₂) hp₁
 #align polynomial.gal.splits_in_splitting_field_of_comp Polynomial.Gal.splits_in_splittingField_of_comp
chore: tidy various files (#5482)
Diff
@@ -17,7 +17,7 @@ import Mathlib.GroupTheory.Perm.Cycle.Type
 
 In this file, we introduce the Galois group of a polynomial `p` over a field `F`,
 defined as the automorphism group of its splitting field. We also provide
-some results about some extension `E` above `p.splitting_field`, and some specific
+some results about some extension `E` above `p.SplittingField`, and some specific
 results about the Galois groups of ℚ-polynomials with specific numbers of non-real roots.
 
 ## Main definitions
feat: port FieldTheory.PolynomialGaloisGroup (#5159)

Co-authored-by: Xavier-François Roblot <46200072+xroblot@users.noreply.github.com> Co-authored-by: Chris Hughes <chrishughes24@gmail.com> Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com>

Dependencies 12 + 1142

1143 files ported (99.0%)
507018 lines ported (98.9%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file